binutils Newspaper
NOVEMBER 30, 2026
vax — Proposed

VAX PIC: Use GOT for global function pointers

Patch modifies VAX PIC to use GOT for global function pointers instead of PLT, fixing Bug 32941.

This patch revises the VAX PIC (Position-Independent Code) generation to use the Global Offset Table (GOT) for pointers to global functions, rather than the Procedure Linkage Table (PLT). This change addresses Bug 32941, which likely involved incorrect function resolution or addressing in PIC code on VAX. The provided code snippet modifies gas/config/tc-vax.c to adjust relocation type selection for function calls and jumps.

In the Thread 2 participants
  1. Rin Okuyama proposer

    Submitted a patch to use GOT instead of PLT for global function pointers in VAX PIC, fixing Bug 32941.

    “Subject: [PATCH] VAX: PIC: Use GOT for pointer for global function in same file, instead of PLT This fixes the problem reported as Bug 32941: https://sourceware.org/bugzilla/show_bug.cgi?id=32941”
  2. Jan-Benedict Glaw reviewer

    Intends to commit the fix, including Rin Okuyama's patch and an added test case.

    “I intend to commit the following patch, containing your fix and adding a testcase for it:”

Technical Tradeoffs

  • Using GOT for global function pointers may simplify address calculation compared to PLT indirections, but requires careful management of GOT entries.
  • The change impacts how function calls are resolved in PIC code, potentially affecting performance or ABI compatibility if not handled correctly.

In Details

This discussion concerns a fix for Position-Independent Code (PIC) generation on the VAX architecture within the GNU assembler. The core issue, Bug 32941, is resolved by changing how global function calls are handled. Instead of always using the PLT (Procedure Linkage Table), the code now defaults to using the GOT (Global Offset Table) for function pointers. This is because indirect function calls through the PLT can introduce an extra indirection via the .got.plt slot, which holds the PLT entry, potentially leading to different effective addresses compared to a direct GOT lookup for the fu…

For Context
Position-Independent Code (PIC)
Code that can run correctly regardless of where it is loaded in memory, crucial for shared libraries.
VAX
A 32-bit complex instruction set computer (CISC) architecture developed by Digital Equipment Corporation (DEC).
GOT
Global Offset Table. A data structure used in executable files and shared libraries to provide an indirection layer for global variables and functions, allowing them to be accessed at a fixed offset from the program counter, which is essential for PIC.
PLT
Procedure Linkage Table. A table used in executable files and shared libraries to resolve indirect function calls, typically used for calls to functions in other shared libraries.
gas
The GNU Assembler, part of the GNU Binutils package.
Filed Under: binutilsvaxpiclinkergot