From Fedora Project Wiki

Description

This test case ensures that binutils provides essential binary utilities and that binutils-gold effectively serves as an alternative linker.

Setup

  1. Ensure you have a Fedora system.
  2. Install the related binutils packages: sudo dnf install binutils binutils-gold.

How to test

  1. Open a terminal.
  2. Check the version of binutils: as --version.
  3. Use the objdump utility (from binutils) to display information about a binary. For example: objdump -d /bin/ls.
  4. Check the output to ensure information about the binary is displayed.
  5. Compile a simple C program using gcc. For instance, you can compile a basic "Hello, World!" program.
  6. Link the program with the traditional GNU linker and note the link time.
  7. Link the program using the Gold linker by passing -fuse-ld=gold to gcc and compare the link time and memory usage.

Expected Results

  1. The as command should display the version information of binutils.
  2. objdump should provide details about the given binary without errors.
  3. The C program should compile and link correctly using both the traditional GNU linker and the Gold linker.
  4. Gold linker should typically have faster link times and use less memory than the traditional linker.

Optional

For deeper testing:

  1. Test more complex programs with multiple dependencies to verify the efficiency of the Gold linker.
  2. Examine other utilities provided by binutils, such as nm, strings, and size.
  3. Check how binutils-gold handles erroneous input or missing dependencies.
  4. Benchmark the linking speed and memory usage of binutils-gold against the traditional linker on larger projects.