| Summary: | --cref on ld.lld writes the cref table to stdout even with -Map=filename | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Jan Martin Mikkelsen <janm> | ||||
| Component: | bin | Assignee: | freebsd-toolchain (Nobody) <toolchain> | ||||
| Status: | Closed Overcome By Events | ||||||
| Severity: | Affects Some People | CC: | i, markj | ||||
| Priority: | --- | ||||||
| Version: | 12.2-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| See Also: | https://bugs.llvm.org/show_bug.cgi?id=48282 | ||||||
| Attachments: |
|
||||||
If this is purely an lld bug, which it appears to be, the bug should be filed with the LLVM project instead. Created attachment 219921 [details]
Patch to make --cref output go to the files specified for -Map=name
Patch to make --cref output go to the file specified for -Map=name
(In reply to Mark Johnston from comment #1) Makes sense, I'll report upstream. In the meantime, a patch that resolves the issue for me is attached in case someone else comes looking for the same problem. Reported to the LLVM project as https://bugs.llvm.org/show_bug.cgi?id=48282 https://reviews.llvm.org/D114663 will implement the GNU ld/gold behavior. bugs.llvm.org is in read-only mode as the issue tracker is being migrated to GitHub. |
The --cref option on ld.lld only seems to write to stdout, ignoring the -Map=filename option. This is a change from GNU ld. To reproduce, compile and link any code with --cref, for example: echo 'int main() { return 0; }' > test.c cc -Wl,-Map=test.map -Wl,--cref test.c The cross reference table is emitted on stdout instead of being written to test.map.