B.3. Changes in binutils

Red Hat Developer Toolset 2.0 is distributed with binutils 2.23.52, which provides a number of bug fixes and feature enhancements over the Red Hat Enterprise Linux system version and the version included in Red Hat Developer Toolset 1.1. Below is a comprehensive list of new features in this release.
The GNU assembler (as), GNU linker (ld), and other binary tools that are part of binutils are now released under the GNU General Public License, version 3.

B.3.1. GNU Linker

Another ELF linker, gold, is now available in addition to ld, the existing GNU linker. gold is intended to be a drop-in replacement for ld, so ld's documentation is intended to be the reference documentation. gold supports most of ld's features, except notable ones such as MRI-compatible linker scripts, cross-reference reports (--cref), and various other minor options. It also provides significantly improved link time with very large C++ applications.
In Red Hat Developer Toolset 2.0, the gold linker is not enabled by default. Users can explicitly switch between ld and gold by using the alternatives mechanism.

B.3.1.1. New Features

Changes Since Red Hat Enterprise Linux 6.4
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 6.4:
  • A new INPUT_SECTION_FLAGS keyword has been added to the linker script language. This keyword can be used to select input sections by section header flags.
  • A new SORT_BY_INIT_PRIORITY keyword has been added to the linker script language. This keyword can be used to sort sections by numerical value of the GCC init_priority attribute encoded in the section name.
  • A new SORT_NONE keyword has been added to the linker script language. This keyword can be used to disable section sorting.
  • A new linker-provided symbol, __ehdr_start, has been added. When producing ELF output, this symbol points to the ELF file header (and nearby program headers) in the program's memory image.
Changes Since Red Hat Enterprise Linux 5.9
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 5.9:
  • GNU/Linux targets now support the STB_GNU_UNIQUE symbol binding, a GNU extension to the standard set of ELF symbol bindings. The binding is passed on to the dynamic linker, which ensures that in the entire process there is only one symbol with the given name and type in use.

    Note

    The implementation of this feature depends on capabilities only found in newer versions of the glibc library. Consequently, this feature is currently available in Red Hat Developer Toolset for Red Hat Enterprise Linux 6.
  • A new command line option --no-export-dynamic has been added. This option can be used to undo the effect of the -E and --export-dynamic options.
  • A new command line option --warn-alternate-em has been added. This option can be used to display a warning if an ELF format object file uses an alternate machine code.
  • A new linker script function REGION_ALIAS has been added. This function can be used to create alias names of memory regions.
  • A new command line option -Ttext-segment address has been added for ELF-based targets. This option can be used to set the address of the first byte of the text segment.
  • A new linker script command INSERT has been added. This command can be used to augment the default script.
  • In a linker script input section, it is now possible to specify a file within an archive by using the archive:file syntax.
  • The --sort-common command line option now accepts ascending and descending as optional arguments. This can be used to specify which sorting order to use.
  • A new command line option --build-id has been added for ELF-based targets. This option can be used to generate a unique per-binary identifier embedded in a note section.
  • A new command line option --default-script=file_name (or -dT file_name) has been added. This option can be used to specify a replacement for the built-in linker script.
  • A new command line option -Bsymbolic-functions has been added. When creating a shared library, this option will cause references to global function symbols to be bound to the definitions with the shared library, if such exist.
  • The new command line options --dynamic-list-cpp-new and --dynamic-list-data have been added, which can be used to modify the dynamic list.

B.3.1.2. Compatibility Changes

Changes Since Red Hat Enterprise Linux 6.4
The following compatibility changes have been made since the release of binutils included in Red Hat Enterprise Linux 6.4:
  • The --copy-dt-needed-entries command line option is no longer enabled by default. Instead, --no-copy-dt-needed-entries is now the default option.
  • Evaluation of linker script expressions has been significantly improved. Note that this can negatively affect scripts that rely on undocumented behavior of the old expression evaluation.
Changes Since Red Hat Enterprise Linux 5.9
The following compatibility changes have been made since the release of binutils included in Red Hat Enterprise Linux 5.9:
  • The --add-needed command line option has been renamed to --copy-dt-needed-entries in order to avoid confusion with the --as-needed option.
  • For GNU/Linux systems, the linker no longer processes any relocations made against symbols of the STT_GNU_IFUNC type. Instead, it emits them into the resulting binary for processing by the loader.

    Note

    The implementation of this feature depends on capabilities only found in newer versions of the glibc library. Consequently, this feature is currently available in Red Hat Developer Toolset for Red Hat Enterprise Linux 6.
  • The --as-needed command line option has been adapted to link in a dynamic library in the following two cases:
    1. if the dynamic library satisfies undefined symbols in regular objects, and
    2. if the dynamic library satisfies undefined symbols in other dynamic libraries unless the library is already found in a DT_NEEDED entry of one of the libraries that are already linked.
  • The -l:file_name command line option now searches the library path for a file name called file_name without adding the .a or .so file extension.

B.3.2. GNU Assembler

B.3.2.1. New Features

Changes Since Red Hat Enterprise Linux 6.4
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 6.4:
  • The GNU Assembler no longer requires double ampersands in macros.
  • A new --compress-debug-sections command line option has been added to enable compression of DWARF debug information sections in the relocatable output file. Compressed debug sections are currently supported by the readelf, objdump, and gold tools, but not by ld.
  • Support for .bundle_align_mode, .bundle_lock, and .bundle_unlock directives for x86 targets has been added..
  • On x86 architectures, the GNU Assembler now allows rep bsf, rep bsr, and rep ret syntax.
Changes Since Red Hat Enterprise Linux 5.9
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 5.9:
  • GNU/Linux targets now support gnu_unique_object as a value of the .type pseudo operation. This value can be used to mark a symbol as globally unique in the entire process.
  • Support for the new discriminator column in the DWARF line table with a discriminator operand for the .loc directive has been added.
  • The .type pseudo operation now accepts a type of STT_GNU_IFUNC. This can be used to indicate that if the symbol is the target of a relocation, its value should not be used. Instead, the function should be invoked and its result used as the value.
  • A new pseudo operation .cfi_val_encoded_addr has been added. This pseudo operation can be used to record constant addresses in unwind tables without runtime relocation.
  • A new command line option -msse-check=[none|error|warning] has been added for x86 targets.
  • The -a command line option now accepts g as a valid sub-option. This combination can be used to enable assembly listings with additional information about the assembly, including the list of supplied command line options or the assembler version.
  • A new command line option -msse2avx has been added for x86 targets. This option can be used to encode SSE instructions with VEX prefix.
  • x86 targets now support the Intel XSAVE, EPT, MOVBE, AES, PCLMUL, and AVX/FMA instructions.
  • New command line options -march=cpu[,+extension], -mtune=cpu, -mmnemonic=[att|intel], -msyntax=[att|intel], -mindex-reg, -mnaked-reg, and -mold-gcc have been added for x86 targets.
  • New pseudo operations .string16, .string32, and .string64 have been added. These pseudo operations be used to generate wide character strings.
  • The i386 port now supports the SSE5 instruction set.
  • A new pseudo operation .reloc has been added. This pseudo operation serves as a low-level interface for creating relocations.

B.3.3. Other Binary Tools

B.3.3.1. New Features

Changes Since Red Hat Developer Toolset 1.1
The following features have been added since the release of binutils included in Red Hat Developer Toolset 1.1:
  • A manual page for the dwp utility has been added.
  • The binary tools now provide support for the AMD Family 15h processors, models 02h and 10-1fh.
Changes Since Red Hat Enterprise Linux 6.4
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 6.4:
  • The readelf and objdump tools can now display the contents of the .debug.macro sections.
  • New --dwarf-start and --dwarf-end command line options have been added to the readelf and objdump tools. These options are used by the new Emacs mode (see the dwarf-mode.el file).
  • A new --interleave-width command line option has been added to the objcopy tool to allow the use of the --interleave to copy a range of bytes from the input to the output.
  • A new --dyn-syms command line option has been added to the readelf tool. This option can be used to dump dynamic symbol table.
  • A new tool, elfedit, has been added to binutils. This tool can be used to directly manipulate ELF format binaries.
  • A new command line option --addresses (or -a for short) has been added to the addr2line tool. This option can be used to display addresses before function and source file names.
  • A new command line option --pretty-print (or -p for short) has been added to the addr2line tool. This option can be used to produce human-readable output.
  • Support for dwz -m optimized debug information has been added.
  • The devtoolset-2-binutils-devel package now provides the demangle.h header file.
Changes Since Red Hat Enterprise Linux 5.9
The following features have been added since the release of binutils included in Red Hat Enterprise Linux 5.9:
  • A new command line option --insn-width=width has been added to the objdump tool. This option can be used to specify the number of bytes to be displayed on a single line when disassembling instructions.
  • A new command line option --relocated-dump=name|number has been added to the readelf tool. This option can be used to display the relocated contents of a section as a sequence of bytes.
  • A new command line option --external-symbols-table=filename has been added to the gprof tool. This option can be used to read a symbol table from a certain file.
  • bfd now supports a plugin target, which can be used to get basic support for new file formats by having the plugin target load the same shared objects used by gold.
  • The --dwarf (or -W for short) command line option of the objdump tool has been adapted to be as flexible as the --debug-dump (or -w) option of readelf.
  • New command line options --prefix=prefix and --prefix-strip=level have been added to the objdump tool. These options can be used to add absolute paths for the --source (or -S for short) option.
  • A new command line option -wL has been added to the readelf tool. This option can be used to dump decoded contents of the .debug_line section.
  • Thin archives are now supported. Instead of containing object files, such archives contain just pathnames pointing to those files.
  • A new command line option -F has been added to the objdump tool. This option can be used to include file offsets in the disassembly.
  • A new command line option -c has been added to the readelf tool. This option can be used to allow string dumps of archive symbol index.
  • The i386 port now supports the SSE5 instruction set.
  • A new command line option -p has been added to the readelf tool. This option can be used to allow string dumps of sections.

B.3.3.2. Compatibility Changes

Changes Since Red Hat Enterprise Linux 5.9
The following compatibility changes have been made since the release of binutils included in Red Hat Enterprise Linux 5.9:
  • The --as-needed command line option has been adapted to link in a dynamic library in the following two cases:
    1. if the dynamic library satisfies undefined symbols in regular objects, and
    2. if the dynamic library satisfies undefined symbols in other dynamic libraries unless the library is already found in a DT_NEEDED entry of one of the libraries that are already linked.