PR #22661 opened by Kacper Michajłow (kasper93) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22661 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22661.patch
The use of code section (.text) was forced by the unreleased NASM 3.02rc3 which made the issue worse, but preventing assambling anything without code section, including when only data was present. This works fine for the most part, but using code (.text) section with IMAGE_COMDAT_SELECT_ANY causes issues with lib.exe after stripping such object: fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x2 Esentially it makes our workaround not work in all cases, and while string could be disabled like it already is for MSVC/ICL builds, it used to work so let's preserve that state. This make it not compatible with NASM 3.02rc3 when CV debug info is generated, but hopefully the upstream fix will be merged before release, to avoid this regression: https://github.com/netwide-assembler/nasm/pull/221 From 7d57621b832a68c7b150fb2aab1c02e14c82144d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]> Date: Mon, 30 Mar 2026 19:38:10 +0200 Subject: [PATCH] avutil/x86/x86util: tone down NASM workaround and use info section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of code section (.text) was forced by the unreleased NASM 3.02rc3 which made the issue worse, but preventing assambling anything without code section, including when only data was present. This works fine for the most part, but using code (.text) section with IMAGE_COMDAT_SELECT_ANY causes issues with lib.exe after stripping such object: fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x2 Esentially it makes our workaround not work in all cases, and while string could be disabled like it already is for MSVC/ICL builds, it used to work so let's preserve that state. This make it not compatible with NASM 3.02rc3 when CV debug info is generated, but hopefully the upstream fix will be merged before release, to avoid this regression: https://github.com/netwide-assembler/nasm/pull/221 Signed-off-by: Kacper Michajłow <[email protected]> --- libavutil/x86/x86util.asm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index 7b259cae6e..da41e2e5ef 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -1025,14 +1025,12 @@ ; NASM panics when emitting CodeView debug info for an empty translation unit. ; GNU binutils `strip` and some other tools such as older MSVC linker also fail -; on such files. Emit a dummy byte in a COMDAT section to work around this. -; The linker will discard it since __x86util_notref is not referenced anywhere. +; on such files. Emit a dummy byte in a section with IMAGE_SCN_LNK_REMOVE flag +; to work around these issues. Sections like that are dropped by the linker. %ifidn __OUTPUT_FORMAT__,win64 - section .text - section .text$__x86util_notref comdat=2:__x86util_notref + section .x86util info db 0 %elifidn __OUTPUT_FORMAT__,win32 - section .text - section .text$__x86util_notref comdat=2:__x86util_notref + section .x86util info db 0 %endif -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
