Skip to content

Commit e596387

Browse files
authored
[LLD][COFF] Use EC symbol table for output DEF file on ARM64X (llvm#125531)
For consistency with input def handling.
1 parent b275309 commit e596387

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lld/COFF/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
26922692

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

26972697
// Set extra alignment for .comm symbols
26982698
for (auto pair : config->alignComm) {

lld/test/COFF/arm64x-export.test

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s
1414
# A command-line export applies only to EC exports.
1515

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

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

77+
RUN: FileCheck --check-prefix=OUT-DEF %s < out.def
78+
OUT-DEF: EXPORTS
79+
OUT-DEF-NEXT: func @1
80+
7781

7882
# Export using the EC .drectve section.
7983

0 commit comments

Comments
 (0)