https://sourceware.org/bugzilla/show_bug.cgi?id=28867
Bug ID: 28867 Summary: Mingw to generate bogus.o on French locale Product: binutils Version: 2.37 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: eric.pouech at orange dot fr Target Milestone: --- Following report to gcc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104399 after adding one letter to a string inside a .c program, compilation and link fails with: /usr/lib/gcc/i686-w64-mingw32/11.2.1/../../../../i686-w64-mingw32/bin/ld: warning: dlls/dxdiagn/provider.cross.o: local symbol `�' has no section /usr/lib/gcc/i686-w64-mingw32/11.2.1/../../../../i686-w64-mingw32/bin/ld: dlls/dxdiagn/provider.cross.o: unrecognized storage class 0 for *UND* symbol `�' /usr/lib/gcc/i686-w64-mingw32/11.2.1/../../../../i686-w64-mingw32/bin/ld: dlls/dxdiagn/provider.cross.o: could not read symbols: file format not recognized I won't post source code (not because I cannot, but because it won't help). Issue really looks like an issue with generating the .o data inside the file, not the content of the .c file itself. will compare three operations: - make without letter change in .c (good.o) - make with letter change in .c (fail.o) - make with letter change in .c and forcing English locale (LC_ALL=C make) (good-eng.o) (the two first are generated with French locale) [eric]$ echo $LANG fr_FR.utf8 result of compilations: - like the names imply: good.o and good.eng are ok - while fail.o generates the errors above ------------------ doing some binary diffs (%.o => %.txt with xxd %.o %.txt) [eric]$ diff good.txt good-eng.txt 1416,1417c1416,1417 < 00005870: 7665 6e64 6f72 2049 4420 3078 2530 3478 vendor ID 0x%04x < 00005880: 2e0a 0000 7300 7a00 4d00 6100 6e00 7500 ....s.z.M.a.n.u. --- > 00005870: 7665 6e64 6f72 2049 4420 3078 2530 346c vendor ID 0x%04l > 00005880: 782e 0a00 7300 7a00 4d00 6100 6e00 7500 x...s.z.M.a.n.u. that's the only diff; just exposing the change in the string (luckily short-alignment didn't shift the rest of the file) now the diff with the bogus.o file [eric]$ diff -C 3 good.txt fail.txt *** good.txt 2022-02-05 18:10:14.103553524 +0100 --- fail.txt 2022-02-05 18:10:05.512628736 +0100 *************** *** 1413,1420 **** 00005840: 7900 7300 4900 6400 0000 7300 7a00 5200 y.s.I.d...s.z.R. 00005850: 6500 7600 6900 7300 6900 6f00 6e00 4900 e.v.i.s.i.o.n.I. 00005860: 6400 0000 556e 6b6e 6f77 6e20 5043 4920 d...Unknown PCI ! 00005870: 7665 6e64 6f72 2049 4420 3078 2530 3478 vendor ID 0x%04x ! 00005880: 2e0a 0000 7300 7a00 4d00 6100 6e00 7500 ....s.z.M.a.n.u. 00005890: 6600 6100 6300 7400 7500 7200 6500 7200 f.a.c.t.u.r.e.r. 000058a0: 0000 0000 2500 6400 2000 7800 2000 2500 ....%.d. .x. .%. 000058b0: 6400 2000 2800 2500 6400 2000 6200 6900 d. .(.%.d. .b.i. --- 1413,1420 ---- 00005840: 7900 7300 4900 6400 0000 7300 7a00 5200 y.s.I.d...s.z.R. 00005850: 6500 7600 6900 7300 6900 6f00 6e00 4900 e.v.i.s.i.o.n.I. 00005860: 6400 0000 556e 6b6e 6f77 6e20 5043 4920 d...Unknown PCI ! 00005870: 7665 6e64 6f72 2049 4420 3078 2530 346c vendor ID 0x%04l ! 00005880: 782e 0a00 7300 7a00 4d00 6100 6e00 7500 x...s.z.M.a.n.u. 00005890: 6600 6100 6300 7400 7500 7200 6500 7200 f.a.c.t.u.r.e.r. 000058a0: 0000 0000 2500 6400 2000 7800 2000 2500 ....%.d. .x. .%. 000058b0: 6400 2000 2800 2500 6400 2000 6200 6900 d. .(.%.d. .b.i. *************** *** 15025,15031 **** 0003ab00: 41c5 0c04 042c 0000 00e8 0500 0034 4f00 A....,.......4O. 0003ab10: 0074 0100 0000 410e 0885 0242 0d05 4687 .t....A....B..F. 0003ab20: 0386 0483 0502 740a c341 c641 c741 c50c ......t..A.A.A.. ! 0003ab30: 0404 480b 0000 0000 2300 0000 9800 0000 ..H.....#....... 0003ab40: 0600 f000 0000 9900 0000 0600 1301 0000 ................ 0003ab50: 9800 0000 0600 d001 0000 9900 0000 0600 ................ 0003ab60: f901 0000 b900 0000 1400 0202 0000 9900 ................ --- 15025,15031 ---- 0003ab00: 41c5 0c04 042c 0000 00e8 0500 0034 4f00 A....,.......4O. 0003ab10: 0074 0100 0000 410e 0885 0242 0d05 4687 .t....A....B..F. 0003ab20: 0386 0483 0502 740a c341 c641 c741 c50c ......t..A.A.A.. ! 0003ab30: 0404 480b 0041 0e08 2300 0000 9800 0000 ..H..A..#....... 0003ab40: 0600 f000 0000 9900 0000 0600 1301 0000 ................ 0003ab50: 9800 0000 0600 d001 0000 9900 0000 0600 ................ 0003ab60: f901 0000 b900 0000 1400 0202 0000 9900 ................ *************** *** 18782,18790 **** 000495d0: 0000 1400 1c05 0000 3600 0000 1400 4805 ........6.....H. 000495e0: 0000 3600 0000 1400 8805 0000 3600 0000 ..6.........6... 000495f0: 1400 b805 0000 3600 0000 1400 ec05 0000 ......6......... ! 00049600: 3600 0000 1400 2e66 696c 6500 0000 0000 6......file..... ! 00049610: 0000 feff 0000 6701 7072 6f76 6964 6572 ......g.provider ! 00049620: 2e63 0000 0000 0000 0000 0000 0000 7200 .c............r. 00049630: 0000 0000 0000 0100 2000 0301 0000 0000 ........ ....... 00049640: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00049650: 0000 8a00 0000 1000 0000 0100 2000 0300 ............ ... --- 18782,18790 ---- 000495d0: 0000 1400 1c05 0000 3600 0000 1400 4805 ........6.....H. 000495e0: 0000 3600 0000 1400 8805 0000 3600 0000 ..6.........6... 000495f0: 1400 b805 0000 3600 0000 1400 ec05 0000 ......6......... ! 00049600: 3600 0000 1400 0000 3600 0000 1400 b805 6.......6....... ! 00049610: 0000 3600 0000 1400 ec05 0000 3600 0000 ..6.........6... ! 00049620: 1400 0000 0000 0000 0000 0000 0000 7200 ..............r. 00049630: 0000 0000 0000 0100 2000 0301 0000 0000 ........ ....... 00049640: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00049650: 0000 8a00 0000 1000 0000 0100 2000 0300 ............ ... *************** *** 19302,19305 **** 0004b650: 696e 6740 3400 5f4b 3332 4765 744d 6f64 ing@4._K32GetMod 0004b660: 756c 6542 6173 654e 616d 6557 4031 3600 uleBaseNameW@16. 0004b670: 5f4b 3332 456e 756d 5072 6f63 6573 734d _K32EnumProcessM ! 0004b680: 6f64 756c 6573 4031 3600 odules@16. --- 19302,19307 ---- 0004b650: 696e 6740 3400 5f4b 3332 4765 744d 6f64 ing@4._K32GetMod 0004b660: 756c 6542 6173 654e 616d 6557 4031 3600 uleBaseNameW@16. 0004b670: 5f4b 3332 456e 756d 5072 6f63 6573 734d _K32EnumProcessM ! 0004b680: 6f64 756c 6573 4031 3600 3600 5f4b 3332 odules@16.6._K32 ! 0004b690: 456e 756d 5072 6f63 6573 734d 6f64 756c EnumProcessModul ! 0004b6a0: 6573 4031 3600 es@16. [eric:~/work/wine-format/build32/dlls/dxdiagn dlls_dxdiagn]$ LC_ALL=C objdump -a fail.o objdump: fail.o: unrecognized storage class 0 for *UND* symbol `�' fail.o: file format pe-i386 fail.o all the files are available (.o, .txt) if needed [eric]$ LC_ALL=C objdump -a fail.o 2>&1 | hexdump -C 00000000 6f 62 6a 64 75 6d 70 3a 20 66 61 69 6c 2e 6f 3a |objdump: fail.o:| 00000010 20 75 6e 72 65 63 6f 67 6e 69 7a 65 64 20 73 74 | unrecognized st| 00000020 6f 72 61 67 65 20 63 6c 61 73 73 20 30 20 66 6f |orage class 0 fo| 00000030 72 20 2a 55 4e 44 2a 20 73 79 6d 62 6f 6c 20 60 |r *UND* symbol `| 00000040 ec 05 27 0a 0a 66 61 69 6c 2e 6f 3a 20 20 20 20 |..'..fail.o: | 00000050 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 70 65 2d | file format pe-| 00000060 69 33 38 36 0a 66 61 69 6c 2e 6f 0a 0a |i386.fail.o..| 0000006d looking at gcc intermediate files (-save-temps) generating the good.s, good-eng.s and fail.s (with same naming conventions as in #1) [eric]$ diff good.s good-eng.s 7812c7812 < .ascii "Unknown PCI vendor ID 0x%04x.\12\0" --- > .ascii "Unknown PCI vendor ID 0x%04lx.\12\0" adding the letter to the string (only diff of two .s files) [eric]$ diff fail.s good-eng.s no difference shown... so forwarding to binutils at gcc bz requests ;-) I didn't attach the various files because of their size. I can of course provide them and do further action on them, whatever is needed. -------------- (for the record the compiler invocation) i686-w64-mingw32-gcc -c -o dlls/dxdiagn/container.cross.o /home/eric/work/wine-format/dlls/dxdiagn/container.c -Idlls/dxdiagn \ -I/home/eric/work/wine-format/dlls/dxdiagn -Iinclude -I/home/eric/work/wine-format/include \ -I/home/eric/work/wine-format/include/msvcrt -D__WINESRC__ -D_UCRT -D__WINE_PE_BUILD -Wall \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \ -fno-omit-frame-pointer -gdwarf-4 -g -O2 ---------------------- [eric]$ i686-w64-mingw32-gcc -v Using built-in specs. COLLECT_GCC=/usr/bin/i686-w64-mingw32-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-w64-mingw32/11.2.1/lto-wrapper Target: i686-w64-mingw32 Configured with: ../configure --prefix=/usr --bindir=/usr/bin --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --with-gnu-as --with-gnu-ld --verbose --without-newlib --disable-multilib --disable-plugin --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-languages=c,c++,objc,obj-c++,fortran --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-threads=posix --with-isl --enable-libgomp --target=i686-w64-mingw32 --with-sysroot=/usr/i686-w64-mingw32/sys-root --with-gxx-include-dir=/usr/i686-w64-mingw32/sys-root/mingw/include/c++ --disable-sjlj-exceptions --with-dwarf2 Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.2.1 20210728 (Fedora MinGW 11.2.1-3.fc35) (GCC) [eric:~/work/wine-format/dlls/dxdiagn dlls_dxdiagn]$ uname -a Linux euterpe 5.15.18-200.fc35.x86_64 #1 SMP Sat Jan 29 13:54:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux [eric]$ dnf list installed | grep binutils binutils.x86_64 2.37-10.fc35 @fedora binutils-gold.x86_64 2.37-10.fc35 @fedora mingw-binutils-generic.x86_64 2.37-3.fc35 @updates mingw32-binutils.x86_64 2.37-3.fc35 @updates mingw64-binutils.x86_64 2.37-3.fc35 @updates -- You are receiving this mail because: You are on the CC list for the bug.