Chapter 12

Toolchain Primer

Abstract

This chapter covers the fundamentals of the various toolchains and ABIs for Linux. This provides developers with the necessary information to understand concepts such as PIC, calling conventions, alignment, and so on. Additionally, techniques are provided for helping the compiler optimize code better, for how to dispatch multiple optimized implementations of code based on the supported CPU features, and for how to leverage x86 assembly.

Keywords

ELF

x86

x86-64

PIC

CPU dispatch

Function dispatch

IFUNC

gcc

as

ld

icc

clang

llvm

nasm

yasm

at&t syntax

CPUID

C99

C11

Get Power and Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.