Red Hat Training

A Red Hat training course is available for Red Hat Developer Toolset

4.3. Using the GNU Linker

To create an executable binary file or a library from object files, run the ld tool as follows:
scl enable devtoolset-6 'ld [option...] -o output_file object_file...'
This creates a binary file named output_file in the current working directory. If the -o option is omitted, the compiler creates a file named a.out by default.
Note that you can execute any command using the scl utility, causing it to be run with the Red Hat Developer Toolset binaries used in preference to the Red Hat Enterprise Linux system equivalent. This allows you to run a shell session with Red Hat Developer Toolset ld as default:
scl enable devtoolset-6 'bash'


To verify the version of ld you are using at any point, type the following at a shell prompt:
which ld
Red Hat Developer Toolset's ld executable path will begin with /opt. Alternatively, you can use the following command to confirm that the version number matches that for Red Hat Developer Toolset ld:
ld -v