Skip to content

Reject nonzero initializers in NOBITS sections #38

Closed

Description

@LunaStev

Current evidence

Audit baseline: master 3ac33ec1, after #11. Source: object/src/formats/elf.rs:176.

Reproduced: .bss containing db 7 succeeds, but the ELF writer emits no payload for it. The explicit initializer is silently discarded.

Reproduction

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

section .text
section .bss
db 7

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

Observed exit status: 0.

Wrote 512 bytes to repro.o

Scope

Difficulty: easy.

Reject incompatible initialized data in BSS or require an explicit section-kind conversion; do not silently replace a nonzero initializer with zero-filled storage.

Completion criteria

  • A nonzero initializer in BSS produces a clear diagnostic.
  • Zero reservations remain supported.
  • Tests inspect section type, size and emitted payload behavior.

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

Activity

  1. added
    bug
    good first issue
    needs testing
    object
    priority medium
    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

    buggood first issueneeds testingobjectpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions