From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) by sourceware.org (Postfix) with ESMTPS id CBAC33858D28 for ; Sun, 16 Jan 2022 11:52:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CBAC33858D28 Received: by smtp60.i.mail.ru with esmtpa (envelope-from ) id 1n945S-0001mU-4U; Sun, 16 Jan 2022 14:52:42 +0300 Date: Sun, 16 Jan 2022 14:52:41 +0300 From: =?Windows-1251?Q?=D4=B8=E4=E0=F0_=D1=F2=F0=FB=E6=ED=B8=A2?=(Fiodar Stryzhniou) To: Richard Earnshaw Cc: gcc-help@gcc.gnu.org Subject: Re: Symbian: unalighned relocations for pointers-to-members Message-Id: <20220116145241.ff761ae396f6b5cef3d53cd0@mail.ru> In-Reply-To: <2fcf11b9-026f-b6e5-1641-025776e90d74@foss.arm.com> References: <20211216033947.6ba586c6ca664cb651cc4cb1@mail.ru> <8f38d61e-f5c2-b9a1-b2d3-3bf5ee5cb4a4@foss.arm.com> <20211229140449.2e727ee2fb05036de93d8ef8@mail.ru> <2fcf11b9-026f-b6e5-1641-025776e90d74@foss.arm.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9CD668969C51240A4A921D689C1A7D0599D6A43519F86D06C182A05F538085040BF88602AE3B479FB244077D419CE7826DF6CD54AFE38917B895A9116AD3B4904 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7607B8778E2C6A697EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637380C9B139A8DC37F8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8AB88E42F0DBCFED4822C94CC3E2F24BF6F9789CCF6C18C3F8528715B7D10C86878DA827A17800CE7E4CD18687D5AE3809FA2833FD35BB23D9E625A9149C048EE1E561CDFBCA1751FF04B652EEC242312D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BEC1C9C6CFAD2A0F5A471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC12179A17907E9E293AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F7900637451939901C68FDC8D81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16B5E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5516078E44DE38914F6EF992BB736E4DA12E8E3CE238FD9BDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7579F2895567E1D60F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A2EC120135420F90F84D6157D2863EC8595188072F44A2A4244A1C44408AB4B562E458535EB929971D7E09C32AA3244C3E468ED7A888433A300A651A33F75FE5408A6A02710B7304729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojfRNKeyHY7NTgY/WVtVAaPA== X-Mailru-Sender: B5420D632883B294CF6673AD81AF0FB6FCB3DDB2CC840BF715410402B81CE1A4E2527C969975515C2B4E3A9B39D17ED8FB559BB5D741EB9638645ACA06CB6E346F53C80213D1719C67EA787935ED9F1B X-Mras: Ok X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2022 11:52:47 -0000 On Tue, 4 Jan 2022 13:01:14 +0000 Richard Earnshaw wrote: > I've had a very quick look at this (I can only look at the compiler > output as I do not have any of the other symbian-related tools). The > only thing I can think of is that the problem is coming from the dwarf > debug information. Can you check whether the problem still occurs if > you add -g0 to the end of the list of compilation options (or remove all > the -g... options from the compilation command). > > R. Sorry for long response. You mail was moved to spam by mail provider. Error remains. I made this file OS-independent. It can be linked and compiled by GCC. I compile and use object dump. Found unaligned entry. Is it error? Output: arm-none-symbianelf-gcc -c -marm main.cpp arm-none-symbianelf-readelf -a main.o Relocation section '.rel.rodata' at offset 0x9e0 contains 8 entries: Offset Info Type Sym.Value Sym. Name 00000058 00000f02 R_ARM_ABS32 00000000 .rodata 00000060 00000f02 R_ARM_ABS32 00000000 .rodata 00000064 00001a02 R_ARM_ABS32 00000000 _ZN5Items17isRune[...] 0000006c 00001b02 R_ARM_ABS32 00000000 _ZN5Items18putRun[...] 00000081 00000f02 R_ARM_ABS32 00000000 .rodata ^^ 00000089 00000f02 R_ARM_ABS32 00000000 .rodata 0000008d 00001a02 R_ARM_ABS32 00000000 _ZN5Items17isRune[...] 00000095 00001b02 R_ARM_ABS32 00000000 _ZN5Items18putRun[...] > > On 29/12/2021 11:04, Ô¸äàð Ñòðûæí¸¢ (Fiodar Stryzhniou) via Gcc-help wrote: > > On Mon, 20 Dec 2021 15:37:26 +0000 > > Richard Earnshaw wrote: > > > >> On 16/12/2021 00:39, Ô¸äàð Ñòðûæí¸¢ (Fiodar Stryzhniou) via Gcc-help wrote: > >>> Hello. I maintain ScummVM port for Symbian Series 60v3. ScummVM is a complete rewrite of hundreds old games' executables and is not an emulator. It's free and opensource. > >>> > >>> Last year, when I prepared a version 2.2.0 in the release, it was faced with the fact that when the Ultima engine is turned on in the executable file (supports Ultima 1, 4, 6, 8), it does not start. Ultima 4 & 6 support disabling allowed SCUMMVM. In the spring of this year, after some changes in the source code Ultima, the elf2e32 utility has begun to complete the work with the error "Line 427". To clarify the causes of the error, a rebeling of the code responsible for the support of Ultima 4 & 6 was carried out. > >>> The rebel passed as follows: > >>> 1. Removed ultima.lib (Static Library) > >>> 2. Left the entry point, deleted all other files associated with Ultima 4/6 from the project assembly > >>> 3. Collected ultima.lib, then collected scummvm.exe > >>> 4. Added files to the project and continued to collect until the error did not jump out. > >>> > >>> I have done these steps first for Ultima 4, then - 6. In both cases, the reason was pointer-to-member array declaration. > >>> Ultima 4 - https://github.com/scummvm/scummvm/blob/master/engines/ultima/ultima4/game/item.cpp#L49 > >>> Ultima 6 - https://github.com/scummvm/scummvm/blob/master/engines/ultima/nuvie/usecode/u6_object_types.h#L28 > >>> > >>> elf2e32 creates E32 aka EPOC32 aka Symbian exe and dlls from elf. > >>> > >>> Analysis of the elf2e32 source code indicated the reason - when checking the created file, unaligned relocations were found. After modifying the source code, the elf2e32 was printed unaligned relocations. I redirect to file "readelf -a ". I find several random Elf32_Rel r_offset from elf2e32 in readelf output. GCC 5.4.0 and 11.2.0 give same result. > >>> > >>> > >> > >> I can't tell from this what the issue might be. To stand any chance of > >> proceeding further, I think we're going to need a simple, > >> self-contained, testcase that can demonstrate the problem. > >> > >> I don't think I've seen a question about SymbianOS support in over 5 > >> years, now, possibly longer. Given that SymbianOS itself was > >> discontinued back around 2013 (8 years ago now), the GCC port has > >> declined to the point where I suspect it's likely to get deprecated > >> soon, due to lack of maintenance. > >> > >> R. > > > > I made very small testcase in main.cpp. Attachment contains Carbide Ñ++ > > project files too if needed. > > > > Console output taken from Carbide C++: > > Using built-in specs. > > COLLECT_GCC=arm-none-symbianelf-gcc > > Target: arm-none-symbianelf > > Configured with: ../gcc-11.2.0/./configure --target=arm-none-symbianelf > > --prefix=/usr/local/gcc-11.2.0 --without-headers --enable-languages=c,c+ > > +,lto --enable-poison-system-directories --enable-lto --with-newlib > > --enable-long-long --with-libiconv-prefix=/usr/local --with-dwarf2 > > --enable-interwork --enable-tls --enable-multilib > > --disable-hosted-libstdcxx --disable-libstdcxx-pch > > --disable-option-checking --disable-threads --disable-nls > > --disable-win32-registry --disable-libssp --disable-shared > > --enable-wchar_t --enable-extra-sgxxlite-multilibs --enable-c99 > > --with-static-standard-libraries Thread model: single Supported LTO > > compression algorithms: zlib gcc version 11.2.0 (GCC) > > COLLECT_GCC_OPTIONS='-g3' '-gdwarf-2' '-fexceptions' '-Wall' > > '-Wno-unknown-pragmas' '-mapcs-frame' '-mthumb-interwork' '-pipe' > > '-nostdinc' '-c' '-Wno-multichar' '-Wno-unused' '-Wformat=0' '-v' > > '-marm' '-mfloat-abi=soft' '-D' '__MARM_INTERWORK__' '-MD' '-D' > > '_DEBUG' '-D' '_UNICODE' '-D' '__GCCE__' '-D' '__SYMBIAN32__' '-D' > > '__S60_50__' '-D' '__S60_3X__' '-D' '__SERIES60_3X__' '-D' '__GCCE__' > > '-D' '__EPOC32__' '-D' '__MARM__' '-D' '__EABI__' '-D' '__MARM_ARMV5__' > > '-D' '__EXE__' '-D' '__SUPPORT_CPP_EXCEPTIONS__' '-D' '__MARM_ARMV5__' > > '-D' > > '__PRODUCT_INCLUDE__="/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant/Symbian_OS.hrh"' > > '-Wno-ctor-dtor-privacy' '-fpermissive' '-std=c++14' '-include' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/INCLUDE/GCCE/gcce.h' '-I' > > '/Symbian/Projects/unalighned_reloc_report/src' '-I' > > '/Symbian/Projects/unalighned_reloc_report/inc' '-I' > > '/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include' '-I' > > '/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant' '-I' > > 'd:/mingw/msys/1.0/local/gcc-11.2.0/lib/gcc/arm-none-symbianelf/11.2.0/include' > > '-o' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.o' > > '-mlibarch=armv5t' '-march=armv5t' '-dumpdir' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/' > > d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../libexec/gcc/arm-none-symbianelf/11.2.0/cc1plus.exe > > -quiet -nostdinc -v -I /Symbian/Projects/unalighned_reloc_report/src > > -I /Symbian/Projects/unalighned_reloc_report/inc > > -I /Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include > > -I /Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant -I > > d:/mingw/msys/1.0/local/gcc-11.2.0/lib/gcc/arm-none-symbianelf/11.2.0/include > > -iprefix d:\mingw\msys\1.0\local\gcc-11.2.0\bin > > \../lib/gcc/arm-none-symbianelf/11.2.0/ > > -MD /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.d > > -MQ /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.o > > -dD -D__USES_INITFINI__ -D __MARM_INTERWORK__ -D _DEBUG -D _UNICODE -D > > __GCCE__ -D __SYMBIAN32__ -D __S60_50__ -D __S60_3X__ -D > > __SERIES60_3X__ -D __GCCE__ -D __EPOC32__ -D __MARM__ -D __EABI__ -D > > __MARM_ARMV5__ -D __EXE__ -D __SUPPORT_CPP_EXCEPTIONS__ -D > > __MARM_ARMV5__ -D > > __PRODUCT_INCLUDE__="/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant/Symbian_OS.hrh" > > -include /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/INCLUDE/GCCE/gcce.h /Symbian/Projects/unalighned_reloc_report/src/main.cpp > > -fno-builtin -fvisibility=hidden -fno-short-enums -fshort-wchar -quiet > > -dumpdir /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/ > > -dumpbase main.cpp -dumpbase-ext .cpp -mapcs-frame -mthumb-interwork > > -marm -mfloat-abi=soft -mlibarch=armv5t -march=armv5t -g3 -gdwarf-2 > > -Wall -Wno-unknown-pragmas -Wno-multichar -Wno-unused -Wformat=0 > > -Wno-ctor-dtor-privacy -std=c++14 -version -fexceptions -fpermissive > > -fno-builtin -fvisibility=hidden -fno-short-enums -fshort-wchar -o - | > > d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../lib/gcc/arm-none-symbianelf/11.2.0/../../../../arm-none-symbianelf/bin/as.exe > > -march=armv5t -mapcs-frame -mfpu=vfp -mthumb-interwork -mfloat-abi=soft > > -meabi=5 > > -o /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.o > > GNU C++14 (GCC) version 11.2.0 (arm-none-symbianelf) compiled by GNU C > > version 6.3.0, GMP version 6.1.0, MPFR version 4.1.0, MPC version > > 1.2.1, isl version isl-0.16.1-GMP > > > > GGC heuristics: --param ggc-min-expand=100 --param > > ggc-min-heapsize=131072 > > #include "..." search starts here: > > #include <...> search starts here: > > /Symbian/Projects/unalighned_reloc_report/src > > /Symbian/Projects/unalighned_reloc_report/inc > > /Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include > > /Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant > > d:/mingw/msys/1.0/local/gcc-11.2.0/lib/gcc/arm-none-symbianelf/11.2.0/include > > End of search list. > > GNU C++14 (GCC) version 11.2.0 (arm-none-symbianelf) > > compiled by GNU C version 6.3.0, GMP version 6.1.0, MPFR > > version 4.1.0, MPC version 1.2.1, isl version isl-0.16.1-GMP > > > > GGC heuristics: --param ggc-min-expand=100 --param > > ggc-min-heapsize=131072 Compiler executable checksum: > > 7bd26c26f5e3795062462f9efc696d4f > > COMPILER_PATH=d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../libexec/gcc/arm-none-symbianelf/11.2.0/;d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../libexec/gcc/;d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../lib/gcc/arm-none-symbianelf/11.2.0/../../../../arm-none-symbianelf/bin/ > > LIBRARY_PATH=d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../lib/gcc/arm-none-symbianelf/11.2.0/;d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../lib/gcc/;d:/mingw/msys/1.0/local/gcc-11.2.0/bin/../lib/gcc/arm-none-symbianelf/11.2.0/../../../../arm-none-symbianelf/lib/ > > COLLECT_GCC_OPTIONS='-g3' '-gdwarf-2' '-fexceptions' '-Wall' > > '-Wno-unknown-pragmas' '-mapcs-frame' '-mthumb-interwork' '-pipe' > > '-nostdinc' '-c' '-Wno-multichar' '-Wno-unused' '-Wformat=0' '-v' > > '-marm' '-mfloat-abi=soft' '-D' '__MARM_INTERWORK__' '-MD' '-D' > > '_DEBUG' '-D' '_UNICODE' '-D' '__GCCE__' '-D' '__SYMBIAN32__' '-D' > > '__S60_50__' '-D' '__S60_3X__' '-D' '__SERIES60_3X__' '-D' '__GCCE__' > > '-D' '__EPOC32__' '-D' '__MARM__' '-D' '__EABI__' '-D' '__MARM_ARMV5__' > > '-D' '__EXE__' '-D' '__SUPPORT_CPP_EXCEPTIONS__' '-D' '__MARM_ARMV5__' > > '-D' > > '__PRODUCT_INCLUDE__="/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant/Symbian_OS.hrh"' > > '-Wno-ctor-dtor-privacy' '-fpermissive' '-std=c++14' '-include' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/INCLUDE/GCCE/gcce.h' '-I' > > '/Symbian/Projects/unalighned_reloc_report/src' '-I' > > '/Symbian/Projects/unalighned_reloc_report/inc' '-I' > > '/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include' '-I' > > '/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/variant' '-I' > > 'd:/mingw/msys/1.0/local/gcc-11.2.0/lib/gcc/arm-none-symbianelf/11.2.0/include' > > '-o' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.o' > > '-mlibarch=armv5t' '-march=armv5t' '-dumpdir' > > '/Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/unalighned_reloc_report/epoc/UNALIGHNED_RELOC_REPORT/GCCE/udeb/main.' > > ‘files copied: 1. line 437 elf2e32 : Error: E1066: Image failed > > validation make[1]: *** [\Symbian\S60_5th_Edition_SDK_v1.0\epoc32 > > \release\gcce\udeb\unalighned_reloc_report.exe] Error 1 make: *** > > [TARGETUNALIGHNED_RELOC_REPORT] Error 2 > > > > ----- > > Ô¸äàð Ñòðûæí¸¢(Fiodar Stryzhniou) > > ----- Ô¸äàð Ñòðûæí¸¢(Fiodar Stryzhniou)