将 objcopy 与 "thin archive" 文件一起使用时出现问题
Problem while using objcopy with "thin archive" file
请使用以下 shell 命令重现问题:
# create subdirectory
mkdir subdir
# create source files with dummy functions
echo 'void func1(){}' > file1.c
echo 'void func2(){}' > ./subdir/file2.c
# compiling sources into object files
gcc -c file1.c -o file1.o
gcc -c ./subdir/file2.c -o ./subdir/file2.o
# creating "thin archive" file from object files
ar crT out.a file1.o ./subdir/file2.o
# running objcopy, which leads to an error
objcopy out.a out_copy.a
因此,出现以下错误:
objcopy:st0AENRL/subdir/file2.o: No such file or directory
P.S。当 "thin" 存档由子目录中的目标文件组成时,objcopy 会出现问题。
有人知道这样的 objcopy 行为是否正常吗?
请使用以下 shell 命令重现问题:
# create subdirectory
mkdir subdir
# create source files with dummy functions
echo 'void func1(){}' > file1.c
echo 'void func2(){}' > ./subdir/file2.c
# compiling sources into object files
gcc -c file1.c -o file1.o
gcc -c ./subdir/file2.c -o ./subdir/file2.o
# creating "thin archive" file from object files
ar crT out.a file1.o ./subdir/file2.o
# running objcopy, which leads to an error
objcopy out.a out_copy.a
因此,出现以下错误:
objcopy:st0AENRL/subdir/file2.o: No such file or directory
P.S。当 "thin" 存档由子目录中的目标文件组成时,objcopy 会出现问题。
有人知道这样的 objcopy 行为是否正常吗?