qualcomm / qualcomm/eld

64-bit variants R_X86_64_(GOTPC64|GOTOFF64|GOT64|PC64) are not supported

Open
#565 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement x86
Dominant language
C++
Stars
259
Forks
84
Avg merge
2d 14h
Merged PRs (30d)
72

Description

We support 32-bit variants of GOT and PC-relative relocations, but not the 64-bit variants: R_X86_64_(GOTPC64|GOTOFF64|GOT64|PC64).

Reproducer:

#!/usr/bin/env bash

cat >1.c <<\EOF
#include <stdio.h>

int u ;

int main() { 
  u = 11;
  printf("u: %d\n", u);
  return 0;
}
EOF

musl-clang -o 1.o 1.c -c -ffunction-sections -static -mcmodel=large
LD=eld musl-clang -o 1.eld.out 1.o -static 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied musl-clang/eld reproducer first and confirm which R_X86_64_* relocation fails. Then inspect eld’s relocation handling for the existing 32-bit GOT and PC-relative variants; done means the four named 64-bit variants link successfully and the resulting executable prints the expected value.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.