binutils Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
binutils/gas/vax

VAX PIC code uses GOT for function pointers.

VAX architecture now uses the Global Offset Table (GOT) for function pointers in Position-Independent Code (PIC), fixing a bug in NetBSD.

This change modifies the VAX gas configuration to use Global Offset Table (GOT) entries for function pointers when generating Position-Independent Code (PIC). Previously, indirect references, including function pointers, could not go through the GOT or PLT. This fix, originating from a NetBSD issue, ensures that function pointers are correctly resolved in PIC executables by using the GOT, aligning with how calls and jumps are handled.

In Details

On the VAX architecture, this commit updates gas/config/tc-vax.c to correctly handle function pointers in PIC code. The md_estimate_size_before_relax function now uses GOT references for function pointers. The rationale is that while calls/jumps may use the PLT, other references (including function pointers) require the symbol's actual address. The GOT is used for this, with a special .got.plt slot holding the PLT entry until lazy binding resolves it. This ensures consistent addressing regardless of when binding occurs.

For Context
VAX
A discontinued line of 32-bit microcomputers developed by Digital Equipment Corporation (DEC), known for its complex instruction set architecture.
PIC code
Position-Independent Code. Code that can be loaded and executed at any memory address without modification. Essential for shared libraries.
GOT
Global Offset Table. A special section in an executable or shared library that stores addresses used by the program, allowing for position-independent code.
PLT
Procedure Linkage Table. A table used in executable files and shared libraries on many systems that allows functions to be called indirectly.
gas
The GNU Assembler, part of the GNU Binutils project.
Filed Under: vaxpicgasoptimization