[llvm] Fix MachO exports trie parsing.
authorJuergen Ributzka <juergen@apple.com>
Mon, 13 Jun 2022 22:57:51 +0000 (15:57 -0700)
committerJuergen Ributzka <juergen@apple.com>
Wed, 15 Jun 2022 16:28:58 +0000 (09:28 -0700)
commit0557c2d58942f98682323dac75b4a55df5eb8f7b
treec2434ed3d727e74d76020ed1e1c82b799f48d80d
parent601ec17d547bf2dc03565b541bae8ec069fbd22b
[llvm] Fix MachO exports trie parsing.

The exports trie parser ordinal validation check doesn't consider the case where
the ordinal can be zero or negative for certain special values that are defined
in BindSpecialDylib. Update the validation to account for that fact and add a
test case.

This fixes rdar://94844233.

Differential Revision: https://reviews.llvm.org/D127806
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/AArch64/nm-flat-reexport.test [new file with mode: 0644]
llvm/test/Object/Inputs/MachO/flat-reexport.yaml [new file with mode: 0644]