Skip to content

Preserve data-reference relocation intent for undefined symbols #37

Closed

Description

@LunaStev

Current evidence

Audit baseline: master 3ac33ec1, after #11. Source: src/commands/asm.rs:241.

Reproduced: extern ext; mov rax, [ext] emits R_X86_64_PLT32. The asm-to-object bridge converts every Relative32 against an undefined symbol to PLT32, including RIP-relative data references.

Reproduction

On Linux x86_64 (Rust 1.96.0), save as repro.asm:

section .text
extern ext
mov rax, [ext]

Run cargo run -- asm --amd64 repro.asm -o repro.o.

Observed exit status: 0.

Wrote 584 bytes to repro.o

Scope

Difficulty: medium.

Carry control-transfer versus data-address relocation intent across the assembler/object boundary. Select PC32, PLT32 or an explicitly requested GOT form from that intent rather than undefined status alone.

Completion criteria

  • External data loads/stores do not receive a call/jump PLT relocation.
  • External call behavior remains deliberately selected and tested.
  • ELF inspection plus a small external-data link/run test validates the result.

Backlog index: #12. This issue owns only the bounded work described above.

Activity

  1. added
    bug
    help wanted
    needs testing
    object
    priority high
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wantedneeds testingobjectpriority high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions