The .init_array code is ELF specific. For ELF platforms,
__USER_LABEL_PREFIX__ is defined as "". Make the simplification
so that downstream ELF targets can build this file even if
__USER_LABEL_PREFIX__ is undefined.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Related: D147085
__USER_LABEL_PREFIX__ is always defined. It is usually defined to nothing though, i.e. just
#define __USER_LABEL_PREFIX__
In this case the file compiles just fine. It does not compile if the prefix is non-empty, e.g.:
#define __USER_LABEL_PREFIX__ _
because it is just a token and not a string.
I don't know if it is valid for the label prefix to be non-empty on ELF platforms (and couldn't find an example),
but I don't see why it couldn't be.
OTOH, for in-tree targets it should be safe to drop the prefix as it always expands to nothing.
Out-of-tree targets may retain it as necessary under target-specific #ifdef.
I'm OK with this change with one nit: could you run clang-format on the changed lines?