Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lld/MachO/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,9 @@ void CStringSection::writeTo(uint8_t *buf) const {

void CStringSection::finalizeContents() {
uint64_t offset = 0;
// TODO: Call buildCStringPriorities() to support cstring ordering when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the comment, would it make sense to log this information to the user if deduplication is not enabled and c-string ordering is specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, but unfortunately we can't tell if an orderfile contains cstrings or just normal symbols without looking at the file itself. They both use the same -order_file flag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that's fair. We'd have to read in the orderfile at some point when specified. In theory, we could thread that information of whether an orderfile contains cstring up to here, but it might not be worth that complexity if this specific case is something a user would even care about.

// deduplication is off, although this may negatively impact build
// performance.
for (CStringInputSection *isec : inputs) {
for (const auto &[i, piece] : llvm::enumerate(isec->pieces)) {
if (!piece.live)
Expand Down