Skip to content

llvm-objcopy regression: Invalid iOS Mach-O: __TEXT segment fileoffset is not zero #130472

@TimNN

Description

@TimNN

llvm-objcopy good bad on an iOS binary produces an output that is considered invalid by dyld.

dyld_info bad fails with:

bad [arm64]:
   __TEXT segment fileoffset is not zero

This regressed in #120995, identified by git bisect and verified by reverting 1a830aa. cc @drodriguez (edit: See #120995 (comment) for what I believe that patch got wrong).

Steps to reproduce (sorry, don't have a version without Rust):

echo "fn main() {}" >> good.rs

# Rust version doesn't matter for this.
# Tested with the latest nightly & stable.
rustc --target=aarch64-apple-ios good.rs

llvm-objcopy good bad

# This is fine:
dyld_info good

# This fails:
dyld_info bad

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions