|can we find the optimization level from obj-file? email@example.com (Jatin Bhateja) (2005-10-26)|
|Re: can we find the optimization level from obj-file? firstname.lastname@example.org (Marco van de Voort) (2005-11-01)|
|From:||Marco van de Voort <email@example.com>|
|Date:||1 Nov 2005 00:24:59 -0500|
|Organization:||Stack Usenet News Service|
|Posted-Date:||01 Nov 2005 00:24:59 EST|
On 2005-10-26, Jatin Bhateja <firstname.lastname@example.org> wrote:
> Now after the assembler converts it into objcode than can it be
> determined at that time to which level that code is optimized
> Though according to me it's not possible but I need your suggestions
> on that.
> [I would think that for a particular compiler and target system, you could
> find patterns generated by each opt level, but in general it seems like a
> hopeless waste of time. -John]
If the binary mustn't be extremely tight, simply add the compiler
options used as a string in the binary.
If not, as John says, you can implement heuristics, but these are horribly
compiler, level, target and (even minor!) version dependant
Moreover, with compilers like gcc, the levels are only global, and more
finegrained control over optimization (on a per specific optimization basis)
is usually possible.
Return to the
Search the comp.compilers archives again.