[PATCH] D158004: llvm-nm ignore the Import symbol file for the --export-symbol option.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 25 01:04:03 PDT 2023
MaskRay added a comment.
In D158004#4616388 <https://reviews.llvm.org/D158004#4616388>, @jhenderson wrote:
> In D158004#4616384 <https://reviews.llvm.org/D158004#4616384>, @MaskRay wrote:
>
>> Changing `llvm::identify_magic` to recognize all files starting with `#!` as `aix_linker_import_file` is not correct. Many can well be used as shebang for shell or other scripts.
>>
>> case '#':
>> if (Magic[1] == '!')
>> return file_magic::aix_linker_import_file;
>> break;
>
> How would you suggest that @DiggerLin proceeds then? The impact of misidentifying a file with a shebang as an AIX import file is that tools will no longer report "invalid object file" or something to that effect for such files, but will otherwise do nothing with them, so it seems relatively harmless to me.
Sorry, I have analyzed the AIX use cases... I just noticed this patch and am concerned that `identify_magic` mischaracterizing files with shebang as AIX-specific would likely cause beyond-negligible negative impacts...
`identify_magic` in LLVMBinaryFormat is somewhat commonly used outside of llvm-project.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158004/new/
https://reviews.llvm.org/D158004
More information about the llvm-commits
mailing list