GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
testsuite/x86

Add -fno-pie to x86 test suite cases that fail with default PIE

Several x86 test cases are modified to use -fno-pie to ensure correct behavior and avoid linker warnings when default PIE is enabled.

A number of tests in the x86 test suite were failing or exhibiting unexpected behavior when compiled with the default Position Independent Executable (PIE) setting. This commit adds the -fno-pie flag to these tests to force non-PIE code generation. This resolves issues related to comdat functions, PLT entries, conditional moves, and assembly constraints that were causing test failures or warnings.

In Details

This commit addresses test case failures on x86 targets when the default build configuration includes -enable-default-pie. Issues arose due to specific code generation patterns for PIE, such as the use of comdat functions for PIC register setup, @PLT entries in call patterns, conditional moves interacting with PIE epilogues, and function addresses used in top-level assembly. The -fno-pie flag is applied to individual test cases to ensure consistent and expected code generation, preventing failures and linker warnings.

For Context
PIE
Position Independent Executable. A binary that can be loaded and run at any arbitrary memory address. This is achieved by avoiding hardcoded addresses and instead using relative addressing.
PIC
Position Independent Code. Code that can be executed regardless of where it is loaded in memory. This is essential for shared libraries and PIE binaries.
PLT
Procedure Linkage Table. A table used in dynamically linked executables to resolve addresses of external functions at runtime.
comdat function
A COMDAT (common data) section that can contain a function. The linker merges COMDAT sections with the same name, which can be used for various purposes, including enabling or disabling certain code paths.
Filed Under: testsuitex86pie