Skip to content

[LLD][COFF] Use EC symbol table for output DEF file on ARM64X #125531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
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
2 changes: 1 addition & 1 deletion lld/COFF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {

// Handle /output-def (MinGW specific).
if (auto *arg = args.getLastArg(OPT_output_def))
writeDefFile(ctx, arg->getValue(), ctx.symtab.exports);
writeDefFile(ctx, arg->getValue(), mainSymtab.exports);

// Set extra alignment for .comm symbols
for (auto pair : config->alignComm) {
Expand Down
6 changes: 5 additions & 1 deletion lld/test/COFF/arm64x-export.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s
# A command-line export applies only to EC exports.

RUN: lld-link -machine:arm64x -dll -out:out-cmd.dll arm64ec-func.obj arm64-func.obj \
RUN: loadconfig-arm64.obj loadconfig-arm64ec.obj -noentry -export:func
RUN: loadconfig-arm64.obj loadconfig-arm64ec.obj -noentry -export:func -output-def:out.def

RUN: llvm-objdump -d out-cmd.dll | FileCheck --check-prefix=DISASM-EC %s
DISASM-EC: Disassembly of section .text:
Expand Down Expand Up @@ -74,6 +74,10 @@ IMPLIB-EC-NEXT: Symbol: func
IMPLIB-EC-NEXT: Symbol: __imp_aux_func
IMPLIB-EC-NEXT: Symbol: #func

RUN: FileCheck --check-prefix=OUT-DEF %s < out.def
OUT-DEF: EXPORTS
OUT-DEF-NEXT: func @1


# Export using the EC .drectve section.

Expand Down