Appendix A. Sourcery G++ Lite Release Notes

This appendix contains information about changes in this release of Sourcery G++ Lite for MIPS ELF. You should read through these notes to learn about new features and bug fixes.

Table of Contents

A.1. Changes in Sourcery G++ Lite for MIPS ELF

A.1. Changes in Sourcery G++ Lite for MIPS ELF

This section documents Sourcery G++ Lite changes for each released revision.

A.1.1. Changes in Sourcery G++ Lite 4.4-124

MIPS startup code fix.  The CS3 startup code for RAM and simulator profile boards now automatically enables the cache.

A.1.2. Changes in Sourcery G++ Lite 4.4-111

Support for MIPS M14K and M14KC processors.  Sourcery G++ Lite now supports the MIPS M14K and M14KC processors. To compile for these targets, use the -march=m14k -mmicromips command-line options. Additionally, CS3 board support is provided for the MIPS SEAD-3 LX50 and LX110 boards which include these processors. Refer to Chapter 5, “CS3™: The CodeSourcery Common Startup Code Sequence” for more information about boards supported by Sourcery G++ Lite.

Support for microMIPS instruction encoding.  Sourcery G++ Lite now supports the microMIPS instruction set architecture. To enable microMIPS code generation, compile and link with -mmicromips.

Code size with -g A bug that caused binary code size regressions in GCC 4.4 when compiling with -g has been fixed.

A.1.3. Changes in Sourcery G++ Lite 4.4-87

Incorrect symbol addresses bug fix.  A bug in the linker that caused it to assign incorrect addresses to symbols has been fixed. The bug occurred when the input objects contained sections not explicitly mentioned in the linker script.

Sourcery G++ Debug Sprite for MIPS.  This release of Sourcery G++ Lite includes the new Sourcery G++ Debug Sprite for MIPS. The Sprite provides similar functionality to the Microprocessor Debug Interface (MDI) protocol support in GDB, but is implemented as an external program which can be run from GDB, rather than in GDB itself. The GDB MDI support is deprecated and will be removed in a future release of Sourcery G++ Lite. For information about using the Sprite, refer to Chapter 6, “Sourcery G++ Debug Sprite”.

Debugging programs built by Green Hills compilers.  GDB has been further extended to accommodate non-standard debug information produced by some Green Hills toolchains.

Optimizer bug fix.  A bug in GCC that caused internal compiler errors at -O2 or above has been fixed. The bug also occurred at other optimization levels when the -fpromote-loop-indices command-line option was used.

Static variables and asm statements bug fix.  A bug in GCC that caused functions containing static variables and asm statements to be miscompiled at -O2 or above has been fixed. The bug also occurred at other optimization levels when the -fremove-local-statics command-line option was used.

Optimizer bug fix.  A bug in GCC that caused functions with complex loop nests to be miscompiled at -O2 or above has been fixed. The bug also occurred at other optimization levels when the -fpromote-loop-indices command-line option was used.

Improved assembler error checking.  The assembler has been improved to perform additional checks for invalid inputs.

A.1.4. Changes in Sourcery G++ Lite 4.4-58

GDB finish internal error.  A bug has been fixed that caused a GDB internal error when using the finish command. The bug occurred when debugging optimized code.

GDB update.  The included version of GDB has been updated to 6.8.50.20090630. This update adds numerous bug fixes and new features, including support for multi-byte and wide character sets and improved C++ template support.

Arguments to main A bug in CS3 YAMON support has been fixed that formerly caused command-line arguments provided on program startup to be ignored. In YAMON profiles, the arguments are now correctly passed to main via argc and argv.

GDB and third-party compilers.  Some bugs that caused GDB to crash when debugging programs compiled with third-party tools have been fixed. These bugs did not affect programs built with Sourcery G++.

GDB internal warning fix.  A GDB bug has been fixed that caused warnings of the form warning: (Internal error: pc address in read in psymtab, but not in symtab.).

@FILE fix.  A bug has been fixed in the processing of @FILE command-line options by GCC, GDB, and other tools. The bug caused any options in FILE following a blank line to be ignored.

Preprocessor error handling.  The preprocessor now treats failing to find a file referenced via #include as a fatal error.

New header file.  The header file mips/m32cache.h has been added to provide declarations for MIPS32 cache management functions. For more information, refer to the MIPS® Toolchain Specifics document.

Bug fix for read A bug in CS3's console I/O support for YAMON has been fixed. The bug caused read to return immediately rather than waiting for input to become available.

ELF file corruption with strip A bug that caused strip to corrupt unusual ELF files has been fixed.

GDB support for Cygwin pathnames.  A bug in GDB's translation of Cygwin pathnames has been fixed.

Startup code debugging fixes.  Two GDB bugs have been fixed that caused errors when debugging startup code. One bug caused an internal error message; the other caused the error Cannot find bounds of current function.

MIPS32 TLB support.  Functions for initialization and maintenance of the CPU's memory management Translation Lookaside Buffer (TLB) have been added to CS3. For more information about TLB support on MIPS ELF targets, refer to the MIPS® Toolchain Specifics document.

Debugging programs built by Green Hills compilers.  GDB has been extended to accommodate non-standard debug information produced by some Green Hills toolchains.

Linker script fixes.  A bug in CS3 linker scripts for YAMON and simulator profiles has been fixed. The bug resulted in data memory being too small, which sometimes caused the stack to be overwritten during initialization, or reduced space for malloc to allocate.

GCC internal compiler error.  A bug has been fixed that caused the compiler to crash when optimizing code that casts between structure types and the type of the first field.

ELF Program Headers.  The linker now better diagnoses errors in the usage of FILEHDR and PHDRS keywords in PHDRS command of linker scripts. Refer to the linker manual for more information.

A.1.5. Changes in Sourcery G++ Lite 4.4-25

Remote debugging hardware watchpoint bug fix.  A GDB bug has been fixed that caused hardware watchpoint hits to be incorrectly reported in some cases.

Optimizer improvements.  When optimizing for speed, the compiler now uses improved heuristics to limit certain types of optimizations that may adversely affect both code size and speed. This change also makes it possible to produce better code when optimizing for space rather than speed.

Binutils update.  The binutils package has been updated to version 2.19.51.20090709 from the FSF trunk. This update includes numerous bug fixes.

Destructor function bug fix.  A bug in CS3 has been fixed that caused functions with the destructor attribute not to be run on program termination.

Support for MIPS 1004K cores.  Sourcery G++ now includes basic compiler and assembler support for MIPS 1004K cores. Use the -march=1004kc (integer cores), -march=1004kf2_1 (half-speed FPU), -march=1004kf1_1 (full-speed FPU), or -march=1004kf (alias for 1004kf2_1) command-line options.

Malta board support.  The Malta 24Kc board definition has been removed from CS3. This board definition was made obsolete in a previous release by the addition of a new generic Malta board definition that is not restricted to 24Kc processors. You should use this generic Malta board definition in place of the deleted 24Kc-specific one. For example, if you were formerly using the malta-24kc-yamon.ld linker script, you should now use malta-yamon.ld. Refer to Chapter 5, “CS3™: The CodeSourcery Common Startup Code Sequence” for a full listing of supported boards and provided linker scripts in this version of Sourcery G++ Lite.

Register variable corruption.  A compiler bug has been fixed that caused incorrect code to be generated when the frame pointer or other special-use registers are used as explicit local register variables, introduced via the asm keyword on their declarations.

Stack unwinding termination bug fix.  A bug has been fixed that caused GDB not to detect the outermost frame correctly while doing stack unwinding. The bug sometimes caused the debugger to go into an infinite loop, or other unpredictable behavior.

-fremove-local-statics optimization.  The -fremove-local-statics optimization is now enabled by default at -O2 and higher optimization levels.

Elimination of spurious warnings about NULL The C++ compiler no longer issues spurious warnings about comparisons between pointers to members and NULL.

Profiling support.  Profiling is now supported for MIPS ELF targets. For more information on profiling with gprof, please see Section 3.6, “Profiling Support”.

Vectorizer improvements.  The compiler now generates improved code for accesses to static nested array variables (e.g. static int foo[8][8];).

Function attributes to support interrupt handling.  Support for the interrupt attribute has been implemented. use_debug_exception, keep_interrupts_masked, and use_shadow_register_set have also been implemented. These are attributes which can be used to modify the behavior of the interrupt handler. For more information on how to use these attributes, please refer to the GCC manual.

GCC version 4.4.1.  Sourcery G++ Lite for MIPS ELF is now based on GCC version 4.4.1. For more information about changes from GCC version 4.3 that was included in previous releases, see http://gcc.gnu.org/gcc-4.4/changes.html.

Linker map address sorting.  The map generated by the linker -Map option now lists symbols sorted by address.

Floating-point register initialization for YAMON.  A bug that caused the floating-point registers to be initialized in the incorrect mode has been fixed. The reset code for YAMON applications now initializes the floating-point register mode to conform to the compilation mode of the application.

A.1.6. Changes in Sourcery G++ Lite 4.3-221

No significant changes.  There are no significant changes for MIPS ELF in this release.

A.1.7. Changes in Sourcery G++ Lite 4.3-219

Malta board support memory map.  Other recent changes to Sourcery G++ have required changing CS3's memory map for MIPS Malta boards to reserve an area of low memory for interrupt vectors. If you are using a CS3-provided Malta linker script for your program, you will pick up the changes automatically. If you are using a copied or custom linker script, you may need to adjust it for this change.

MIPSsim board support.  CS3 now includes a board definition intended specifically for use with MIPSsim targets. If you were previously using a Malta linker script to build a program intended to run on MIPSsim, you must change to use the new MIPSsim linker script instead. When invoking the linker from the command line, use the -T mipssim-hosted.ld option to select the new linker script. Using the new MIPSsim-specific linker script for MIPSsim targets is now necessary because other recent changes to Sourcery G++ have required changes to the memory map used by CS3 that are incompatible between MIPSsim and Malta hardware targets.

A.1.8. Changes in Sourcery G++ Lite 4.3-199

MIPS Malta board support.  Support for a generic Malta board has been added to CS3. This is similar to the existing Malta 24Kc board support, but is not specific to a particular processor, to reflect the fact that these boards can be configured with a number of different processors. If you were previously using the Malta 24Kc CS3 board support with a processor other than the 24Kc, you should switch to using the new generic Malta board instead. Refer to Chapter 5, “CS3™: The CodeSourcery Common Startup Code Sequence” for more information about CS3 support for these boards.

Incorrect linker diagnostic removed.  The linker has been corrected to not emit an error message when the load address of an output section with no contents overlaps an output section with contents. This can occur in linker scripts that use MEMORY regions and AT> to place initialized contents into ROM.

GDB backwards compatibility fix.  A bug has been fixed that caused GDB to crash when loading symbols from binaries built by very old versions of GCC.

Overloaded function resolution.  The C++ compiler now correctly diagnoses an error when the second operand of a comma expression is an unresolved set of overloaded functions. Previously, it incorrectly used the context of the comma expression to resolve the function.

Pointer-to-member functions.  A bug has been fixed that caused the C++ compiler to crash when compiling a pointer-to-member function reference without an explicit & operator. This syntax is allowed only when the -fms-extensions command-line option is used.

New assembler option: -mfix-24k The assembler now accepts the -mfix-24k command-line option. The use of this option causes the assembler to work around hardware errata in the eret and deret instructions on 24K and 24KE cores.

A.1.9. Changes in Sourcery G++ Lite 4.3-152

Reduced compilation time.  Compilation and build times when using Sourcery G++ Lite are now slightly faster. This performance improvement is the result of building the compilers and other host tools with a recent version of Sourcery G++, rather than an older GCC version.

Linker script load address processing.  A bug in the linker has been fixed affecting linker scripts using AT>region to set the load address. This now follows the documented behavior of maintaining the virtual address to load address difference in output section statements. Refer to the "Output Section LMA" section of the linker manual for details of how to control the load address.

Hardware floating point emulation library.  The hardware floating point emulation support which was formerly included with the SDE library is now available as part of CS3. This library provides trap handlers for unsupported floating-point instructions, which invoke the corresponding soft-float library routines. To use the library in your code, compile with -mhard-float and link with -lcs3-mips-cp1 -lcs3-mips-fpemu -Wl,--defsym,__cs3_mips_float_type=2 . For more information about floating-point support on MIPS ELF targets, refer to the MIPS® Toolchain Specifics document.

mips-sde-elf-objcopy bug fix.  A bug has been fixed that caused mips-sde-elf-objcopy to issue an error when generating output in the Intel HEX format and using --change-section-lma to change section addresses.

Linker script search path.  The bug in the linker has been fixed that caused it not to follow its documented behavior for searching for linker scripts named with the -T option. Now scripts are looked up first in the current directory, then in library directories specified with -L command-line options, and finally in the default system linker script directory.

Internal compiler error when optimizing.  A bug has been fixed that caused internal compiler error: in build2_stat when compiling.

Corruption of block-scope variables.  A compiler optimization bug that sometimes caused corruption of stack-allocated variables has been fixed. The bug affected variables declared in a local block scope in functions containing multiple non-overlapping lexical block scopes, a technique commonly used by programmers to reduce stack frame size. In some rare cases, other optimizations performed by the compiler were ignoring the local extent of such block-scope variables.

A.1.10. Changes in Sourcery G++ Lite 4.3-147

Optimized math routines.  The Newlib implementations of rint, drem, sqrtf and sqrt have been replaced with the versions of these functions that were formerly included with the SDE math library, and are optimized specifically for MIPS targets.

mips-sde-elf-objdump bug fix.  A bug has been fixed that caused mips-sde-elf-objdump to enter an infinite loop.

Incorrect code when using -falign-labels A bug that caused the compiler to generate incorrect code for switch statements when the -falign-labels option is used has been fixed.

Debug section placement.  A linker script bug in CS3 has been fixed that caused .debug_ranges debug sections to be misplaced.

MDI semihosting.  A bug in MDI semihosting that could result in a crash when making a system call (such as read or write) has been fixed.

Interrupting the target from the debugger.  GDB has been improved to be more responsive to attempts to interrupt the target (as by a Ctrl+C when using GDB from the command line) during execution of programs using semihosting.

Loop optimization improvements.  A new option, -fpromote-loop-indices, has been added to the compiler. Specifying this option enables an optimization that improves the performance of loops with index variables of integer types narrower than the target machine word size, such as char or short. This optimization also applies to int on 64-bit targets.

Optimized string and memory functions.  The Newlib implementations of memcpy, memcmp, bzero, strcmp, strcpy, strlen and memset have been replaced with the versions of these functions that were formerly included with the SDE C library, and are optimized specifically for MIPS targets.

Remote debugging connection auto-retry.  The target remote command within GDB now uses a configurable auto-retry timeout when establishing TCP connections. This is useful in avoiding race conditions when the remote GDB stub or GDB server is launched simultaneously with GDB. The auto-retry behavior is enabled by default; refer to the GDB manual for details.

Extraneous linker error messages.  A linker bug that caused extraneous error messages of the form Dwarf Error: Offset (507) greater than or equal to .debug_str size (421). has been corrected. This bug did not affect the correctness of output binaries.

GDB quit error.  A bug in GDB has been fixed that caused quit to report Quitting: You can't do that without a process to debug. when debugging a core dump file.

GDB update.  The included version of GDB has been updated to 6.8.50.20081022. This update includes numerous bug fixes.

A.1.11. Changes in Sourcery G++ Lite 4.3-113

GCC version 4.3.3.  Sourcery G++ Lite for MIPS ELF is now based on GCC version 4.3.3. This is a bug fix update to GCC. For more information about changes from GCC version 4.3.2 that was included in previous releases, see http://gcc.gnu.org/gcc-4.3/changes.html.

Arguments to main A bug in CS3 hosting support has been fixed that formerly caused command-line arguments provided on program startup to be ignored. In hosted environments, the arguments are now correctly passed to main via argc and argv.

Internal compiler error with -O3 or -fpredictive-commoning A bug has been fixed that caused internal compiler errors when compiling some code with -O3 or -fpredictive-commoning.

Debug information for anonymous structure types.  A GCC bug in the generation of debug information for anonymous structure types in C++ code has been fixed. The bug caused printing the type information for such structures in the debugger (via the ptype command) to fail with an error message.

Out-of-range branches.  A bug has been fixed that caused the compiler to emit incorrect branch code in some very large functions when generating position-independent code (-fpic) for O32 (-mabi=32) or O64 (-mabi=o64) ABIs.

Newlib update.  The Newlib package has been updated to version 1.17.0, with additions from the community CVS trunk as of 2009-02-24. This update provides new C99 wide-character functions; POSIX regex functions; string-function performance improvements; an improved sprintf implementation that no longer requires I/O functions like _open, _write, and _close; and other bug fixes and improvements. For more information, refer to the Newlib C Library and Math Library manuals, and to the Newlib web site at http://sourceware.org/newlib/.

Installer fails during upgrade.  The Sourcery G++ installer for Microsoft Windows hosts could fail during an upgrade while waiting for the previous version to be uninstalled. This bug has been fixed.

Uninstaller removed by upgrade.  The uninstaller could be incorrectly deleted during an upgrade on Microsoft Windows hosts. This bug has been fixed.

Compile-time error for some -march options.  A bug has been fixed that caused the error message: mips-sde-elf-gcc: switch '|march=octeon' does not start with '-' to be reported. The bug affected programs compiled with the options -march=mips64, -march=5k, -march=20k, -march=sb1 and -march=r71000.

Internal compiler errors when optimizing.  A defect that occasionally caused internal compiler errors when partial redundancy elimination (PRE) optimization was enabled has been corrected.

Install directory pathnames.  Bugs in the install and uninstall scripts for Linux hosts that caused errors or incorrect behavior when the Sourcery G++ install directory pathname contains whitespace characters have been fixed.

Temporary files on Microsoft Windows.  On Microsoft Windows hosts, Sourcery G++ Lite now uses the standard Windows algorithm to choose the directory in which to place temporary files. This change eliminates a crash that occurred if none of the TEMP, TMP, or TMPDIR variables were set to a suitable directory.

Binutils update.  The binutils package has been updated to version 2.19.51.20090205 from the FSF trunk. This update includes numerous bug fixes.

CS3 board and processor support.  CS3 board and processor support has been cleaned up to remove entries that are not appropriate for or supported by Sourcery G++ Lite on MIPS ELF targets. This includes processors for which Sourcery G++ Lite does not include appropriate run-time libraries. These changes are intended to simplify processor and board selection. For the full list of boards supported by CS3, refer to Chapter 5, “CS3™: The CodeSourcery Common Startup Code Sequence”.

Internal compiler error with -fremove-local-statics An internal compiler error that occurred when using the -fremove-local-statics option has been fixed. The error occurred when compiling code with function-local static array or structure variables.

A.1.12. Changes in Sourcery G++ Lite 4.3-81

C++ named operators bug fix.  A bug has been fixed that caused the compiler to crash in some cases when the C++ operators and_eq, bitand, bitor, compl, not_eq, or_eq and xor_eq were used in contexts where the preprocessor converts their names to strings.

GDB target extended-remote error.  A bug in GDB has been fixed that caused target extended-remote to report Remote failure reply: E01 if no remote program was running.

GDB segment warning.  Some compilers produce binaries including uninitialized data regions, such as the stack and heap. GDB incorrectly displayed the warning Loadable segment "name" outside of ELF segments for such binaries; the warning has now been fixed.

A.1.13. Changes in Sourcery G++ Lite 4.3-59

Setting breakpoints on Windows.  A bug in GDB on Microsoft Windows hosts has been fixed. The bug caused setting breakpoints on a source line by using the file's full path to fail with No source file named filename.

Handling of out-of-range values by strtof The strtof function now sets errno to ERANGE when the input is not representable as a float, as required by the ISO C standard.

Printing casted values in GDB.  A GDB bug that caused incorrect output for expressions containing casts, such as in the print *(Type *)ptr command, has been fixed.

Bug fix for objcopy/strip.  An objcopy bug that corrupted COMDAT groups when creating new binaries has been fixed. This bug also affected strip -g.

Bug fix for assembly listing.  A bug that caused the assembler to produce corrupted listings (via the -a option) on Windows hosts has been fixed.

DSP support.  The compiler now automatically enables support for the DSP ASE when the -march option is used to specify a core in the 24KE, 34K, or 74K families. It is no longer necessary to provide the -mdsp option explicitly.

GDB update.  The included version of GDB has been updated to 6.8.50.20080821. This update adds numerous bug fixes and new features, including support for decimal floating point, the new find command to search memory, the new /m (mixed source and assembly) option to the disassemble command, and the new macro define command to define C preprocessor macros interactively.

PIE linking fix.  A bug in the GCC -fpie and -fPIE options has been fixed. The bug caused linker errors referring to R_MIPS_HI16.

Binutils support for DWARF Version 3.  The addr2line command now supports binaries containing DWARF 3 debugging information. The ld command can display error messages with source locations for input files containing DWARF 3 debugging information.

GDB support for YAMON.  GDB now supports debugging via the YAMON boot loader GDB stub. Consult YAMON documentation for details on enabling the GDB stub.

GDB Support for MIPSsim on Windows.  A bug in the GDB support for MIPSsim on Microsoft Windows hosts has been fixed. The bug caused the target mdi command to fail with the error Cannot find MIPSsim config file template: mipssim.cfg.

CodeSourcery Common Startup Code Sequence.  Support for CS3, CodeSourcery's unified startup scheme, has been added to this release. CS3 replaces the MIPS-provided MDI startup code and linker scripts included in previous releases. Refer to Chapter 5, “CS3™: The CodeSourcery Common Startup Code Sequence” for more information about CS3, including details about the boards and linker scripts supported by this release. Note that the Malta board configuration is usable by MIPSsim and the included GDB simulator as well as actual Malta hardware targets.

GDB display of source.  A bug has been fixed that prevented GDB from locating debug information in some cases. The debugger failed to display source code for or step into the affected functions.

FPU defaults.  The -ffast-math option now causes subnormal numbers to be immediately flushed to zero. It also sets the rounding mode to round-to-nearest.

Connecting to the target using a pipe.  A bug in GDB's target remote | program command has been fixed. When launching the specified program failed, the bug caused GDB to crash, hang, or give a message Error: No Error.

Output files removed on error.  When GCC encounters an error, it now consistently removes any incomplete output files that it may have created.

Placing bss-like regions in load regions.  The linker no longer issues an incorrect error message when a bss-like section is placed at specific load region. The linker formerly incorrectly considered the section as taking up space in the load region.

-mwarn-framesize=size option.  GCC has a new command-line option, -mwarn-framesize=size, which causes warnings if any function's stack frame exceeds the given size. This option is useful when generating code for environments with limited or absent stack, e.g., BIOS.

Newlib manuals.  The documentation packaged with Sourcery G++ Lite now includes the Newlib C Library and Math Library manuals.

GCC version 4.3.2.  Sourcery G++ Lite for MIPS ELF is now based on GCC version 4.3.2. For more information about changes from GCC version 4.2 that was included in previous releases, see http://gcc.gnu.org/gcc-4.3/changes.html.

Spurious GDB error message fixed.  A spurious Current thread went away!? message is no longer generated when using GDB to debug programs running on cores that do not support hardware multi-threading. This problem was specific to the MDI target support in GDB.

Unnecessary section removed.  A linker bug that caused an unnecessary .rel.dyn section to be placed in the executable has been fixed.

Linker bug fix for --gc-sections A linker bug that caused certain linker-generated sections to be incorrectly omitted from the executable when the --gc-sections option is used has been fixed.

Errors after loading the debugged program.  An intermittent GDB bug has been fixed. The bug could cause a GDB internal error after the load command.

Bug fix for objdump on Windows.  An objdump bug that caused the -S option not to work on Windows in some cases has been fixed.

Persistent remote server connections.  A GDB bug has been fixed that caused the target extended-remote command to fail to tell the remote server to make the connection persistent across program invocations.

A.1.14. Changes in Older Releases

For information about changes in older releases of Sourcery G++ Lite for MIPS ELF, please refer to the Getting Started guide packaged with those releases.