Skip to content

llvm-objcopy does not work on Rust .rlib archive files #53395

Open
@jeffy1009

Description

@jeffy1009

Rust .rlib archive files contains object files and .rmeta files. Tools for working with .rlib file has been requested for several years but there's still no work on it yet. (rust-lang/rust#25820)

Most of the commands like nm, objdump, etc. work on .rlib file, although there is an error message about unrecognized format of .rmeta files. objcopy is one of them, and commands like objcopy -W foo libxxx.rlib still work, even though it complains about unrecognized .rmeta file.

But it seems that llvm-objcopy does not commit the changes to .rlib files if an error occurs.

I don't know if the policy is to mimic GNU tools' behavior, but it would be a lot more convenient if llvm-objcopy would behave similarly to objcopy in cases like this, provided that the side-effects caused by this change is expected to be small.
Otherwise, I have to extract the archive, apply the change to individual object files, and recreate the archive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproving things as opposed to bug fixing, e.g. new or missing featurerustRust languagetools:llvm-objcopy/strip

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions