flat assembler
Message board for the users of flat assembler.

Index > Main > Section Alignment

Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Greetings everyone!
I got little question about section alignment.
Is there possible to change default value of that to any other value ? if it is, how can I do that ? Thank you.
as I found in search results, it's not possible to apply arbitrary values to it. Can developers add such function to FASM ? It would be great! (at least, for me.)
Post 04 Dec 2011, 14:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16995
Location: In your JS exploiting you and your system
revolution
If you have specific requirements for section alignment then you can edit the fasm source to generate whatever alignment you require.
Overflowz wrote:
Can developers add such function to FASM ?
The short answer is yes. But you will have to provide a good argument for why it is necessary to provide the "developers" with an incentive to make time include it. And until such a time comes (if ever) when the "developers" (aka Tomasz) adds such a thing when just use my first suggestion above.
Post 09 Dec 2011, 20:07
View user's profile Send private message Visit poster's website Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
Modern Windowses doesn't accept arbitrary values. If you need to squeeze file alignment for some older OS, you will probably not mind that much to bake your own PE.

I'm not too familiar with ELF, are there segment alignments there?
Post 09 Dec 2011, 21:31
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
revolution
Hi, I though this option will reduce size of executable when compiled (saw example on VC++ compiler with #pragma comment(linker,"/align 200" or something, don't remember.) That's the only the reason, nothing else. If it's false, just ignore this thread.
mindcooler
I'm don't know ELF formats yet, but gonna learn soon, cause I'm going to move to Unix/Linux systems.
Post 09 Dec 2011, 22:08
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
I agree with the suggestion. The feature is not as important as e.g. custom default stack size specification, but for the sake of completeness it makes sense to allow also file and section alignment customization with an additional directive of the same kind as entry or stack.
Post 09 Dec 2011, 23:33
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Just wanted to ask, whether you have any plans regarding the topic.
Post 17 Apr 2012, 16:17
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7564
Location: Kraków, Poland
Tomasz Grysztar
No. By PE specification, the file alignment cannot be less than 512 bytes, and I see no reason why one would need bigger alignment, as it would only increase the file size. If it was just to have the option just for the sake of it, then it would not be worth the amount of work required to adjust the formatter.
Post 17 Apr 2012, 16:34
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Fair enough. Thanks for the information.
Then the officially invalid alignment values, starting from 4, are going to be achievable only by the manually created PEs.
Post 17 Apr 2012, 16:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.