Skip to content

llvm-objcopy prints wrong path when output directory doesn't exist #125113

@srpape

Description

@srpape

When the output directory doesn't exist, llvm-objcopy prints the input argument in the error string.
Tested with llvm-objcopy-19.

Example to reproduce:

# We get permission denied if we try to use /usr/bin/ls directly
$ cp /usr/bin/ls ./ls

# ./invalid-dir does not exist, we get an incorrect error message
$ llvm-objcopy-19 --dump-section .text=./invalid-dir/text ./ls 
llvm-objcopy-19: error: './ls': No such file or directory

# If we create the directory, it will succeed
$ mkdir invalid-dir
$ llvm-objcopy-19 --dump-section .text=./invalid-dir/text ./ls #succeeds

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions