This creates a symbol alias similar to --defsym in the elf linker. This
is used by swiftpm for all executables, so it's useful to support. This
doesn't implement -alias_list but that could be done pretty easily as
needed.
Details
- Reviewers
int3 oontvoo - Group Reviewers
Restricted Project - Commits
- rG0bc100986c25: [lld-macho] Add support for -alias
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/MachO/Driver.cpp | ||
---|---|---|
1569–1573 | i wonder if it's worth adding a Symtab::copy(<src>, <target>) rather than listing all the symbol's internals here. (reason being that occasionally we do add a new field, which means going to hunt down all these instances and update them - kind of bug-prone) | |
lld/test/MachO/aliases.s | ||
8 | nit: this shouldn't be needed (ie., the tests should be in the OPT framework, not LLD-macho since it's not implementing argument parsing code) |
Move alias logic into SymbolTable.cpp
lld/MachO/Driver.cpp | ||
---|---|---|
1569–1573 | Yea good idea, I moved it. I didn't see any other similar logic today so I made it specific to this use case, but it still seems nicer to live with the other symtab logic. lmk what you think! |
Is it time to do the 2nd FIXME in MarkLive.cpp now?
// FIXME: When we implement these flags, make symbols from them GC // roots: // * -reexported_symbol(s_list) // * -alias(-list) // * -init
Ah thanks, submitted https://reviews.llvm.org/D135082. I also ran that test against ld64 and it passed, otherwise I didn't look at the ld64 behavior
const auto &