mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 04:16:46 +00:00

Before this, LLD sets OrdinalBase to 0, which deviates from usual practices. This technically would allow LLD to export a symbol using ordinal 0, however LLD never use export ordinal 0, which results in binaries with export tables always having an empty export at ordinal 0. This change makes LLD set OrdinalBase to 1 and not create the empty export with ordinal 0, which makes its behaviour more in line with both the MSVC linker and the GNU linker. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D134140
21 lines
889 B
ArmAsm
21 lines
889 B
ArmAsm
# REQUIRES: x86
|
|
#
|
|
# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-head.s -filetype=obj -o %t-dabcdh.o
|
|
# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-func.s -filetype=obj -o %t-dabcds00000.o
|
|
# RUN: llvm-mc -triple=x86_64-windows-gnu %p/Inputs/gnu-implib-tail.s -filetype=obj -o %t-dabcdt.o
|
|
# RUN: rm -f %t-implib.a
|
|
# RUN: llvm-ar rcs %t-implib.a %t-dabcdh.o %t-dabcds00000.o %t-dabcdt.o
|
|
# RUN: lld-link -lldmingw -dll -out:%t.dll -entry:main -subsystem:console \
|
|
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib %t-implib.a -include:func
|
|
# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix=EXPORT %s
|
|
|
|
# Check that only the single normal symbol was exported, none of the symbols
|
|
# from the import library.
|
|
|
|
EXPORT: Export {
|
|
EXPORT-NEXT: Ordinal: 1
|
|
EXPORT-NEXT: Name: main
|
|
EXPORT-NEXT: RVA: 0x1010
|
|
EXPORT-NEXT: }
|
|
EXPORT-NEXT-EMPTY:
|