Ah, it was -malign-data, not -falign-data   no wonder I didn't find it.  DUH

-----Original Message-----
From: Liu Hao [mailto:lh_mo...@126.com] 
Sent: Wednesday, August 02, 2017 11:54 AM
To: mingw-w64-public@lists.sourceforge.net; Madalinski Piotr
<piotr.madalin...@zf.com>
Subject: Re: [Mingw-w64-public] FW: Section sizes too big in object files
(possible bug?)

On 2017/8/2 19:42, Madalinski Piotr wrote:
> Hi all,
> 
> I'm having trouble with getting correct section sizes under MinGW.
> The example below demonstrates the issue:
> 
> (... abridgement ...)
> 
> Adding align(1) attribute to the data definition is a workaround, that
fixes the problem, but due to external factors I want to avoid adding it, if
possible.
> This behavior looks as a bug to me, but I can't say for sure.
> Anyhow - is there some other (than the align(1) attribute) approach that
this behavior can be changed? Compiler option maybe?
> 

`-malign-data=abi` shall fix the problem by minimizing the alignment
requirement:

```plaintext
E:\Desktop>gcc test.c -Wl,-s && objdump -h a.exe | grep -F test_sec
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
   2 test_sec      00000040  00404000  00404000  00001c00  2**5

E:\Desktop>gcc test.c -Wl,-s -malign-data=abi && objdump -h a.exe | grep -F
test_sec
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
   2 test_sec      00000024  00404000  00404000  00001c00  2**2

```

Reference: 
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/x86-Options.html#x86-Options

--
Best regards,
LH_Mouse


----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to