You are not logged in.

#1 2004-08-13 21:09:26

Fox
Member
Registered: 2004-07-28
Posts: 124

Get binary optimization

How can I get the optimization of a binary file (i686, i586, etc.)?

Fox

Offline

#2 2004-08-13 21:23:24

aCoder
Member
From: Medina, OH
Registered: 2004-03-07
Posts: 359
Website

Re: Get binary optimization

Well... ummm... What exactly is it that you want to do?


If you develop an ear for sounds that are musical it is like developing an ego. You begin to refuse sounds that are not musical and that way cut yourself off from a good deal of experience.
  - John Cage

Offline

#3 2004-08-13 21:56:54

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Get binary optimization

You can't.

Offline

#4 2004-08-14 09:36:13

Fox
Member
Registered: 2004-07-28
Posts: 124

Re: Get binary optimization

If you optimize a binary for an arch e.g. i686 you use functions wich are only avaible on this arch. So there must be a program wich tells you if the binary uses this special functions.

Fox

Offline

#5 2004-08-14 14:40:20

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Get binary optimization

Oh you can scan for certain opcodes and such, but that's plain silly. You still don't know the optimization flags, only -march, but that's not very interesting. You can as wel simply try out the binary, then you'd know if it works for you or not.

Offline

#6 2004-08-14 17:35:27

jak
Member
From: Charlotte, NC, USA
Registered: 2004-04-08
Posts: 84

Re: Get binary optimization

Fox wrote:

How can I get the optimization of a binary file (i686, i586, etc.)?

Adjust your CFLAGS in /etc/makepkg.conf and build from source with makepkg. You also need abs, the arch build system.


The sturgeon general says don't smoke fish

Offline

#7 2004-08-14 17:48:16

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Get binary optimization

You can pacman -Qi <package name> if it's installed on your system.

If you have a pkg.tar.gz file, you can pacman -Qip <package file>.

I was suggesting we change the names of the packages to reflect architecture, but some of the other developers don't like the idea...


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#8 2004-08-14 19:59:39

Fox
Member
Registered: 2004-07-28
Posts: 124

Re: Get binary optimization

But the binary itself can't be checked for its arch?

Fox

Offline

#9 2004-08-14 21:14:15

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Get binary optimization

Fox wrote:

But the binary itself can't be checked for its arch?

The great wonders of the "file" utility:

# file /usr/bin/pacman
/usr/bin/pacman: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.0, statically linked, stripped

Offline

#10 2004-08-15 00:46:50

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Get binary optimization

Fox wrote:

But the binary itself can't be checked for its arch?

No, files themselves are just collections of machine instructions.  You could run statistical analysis tools looking for common instruction combinations... but... do you really want to?


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#11 2004-08-15 10:29:45

Fox
Member
Registered: 2004-07-28
Posts: 124

Re: Get binary optimization

Xentac wrote:
Fox wrote:

But the binary itself can't be checked for its arch?

No, files themselves are just collections of machine instructions.  You could run statistical analysis tools looking for common instruction combinations... but... do you really want to?

And how to do this?

Fox

Offline

#12 2004-08-15 16:50:06

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Get binary optimization

I've never heard of anyone doing this.  You'll have to have intimate knowledge of each architecture's intstruction set and write a program to use statistics and fuzzy logic to figure out the instruction set.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#13 2004-08-15 19:12:36

kleptophobiac
Member
From: Sunnyvale, CA
Registered: 2004-04-25
Posts: 489

Re: Get binary optimization

Stats and fuzzy logic? Sounds like fuzzy math to me! 8)

Just out of curiousity, why?

Offline

#14 2004-08-15 20:31:52

dp
Member
From: Aarau, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: Get binary optimization

Fox wrote:
Xentac wrote:
Fox wrote:

But the binary itself can't be checked for its arch?

No, files themselves are just collections of machine instructions.  You could run statistical analysis tools looking for common instruction combinations... but... do you really want to?

And how to do this?

Fox

i don't know how to do this ... if you are really interested in doing something like this, i would suggest, that you use a virtual PC to emulate different archs and test the binary to run on them

the only resource to look in detail on ELF binaries i know is this:
http://uqconnect.net/~zzoklan/software/elftools/


The impossible missions are the only ones which succeed.

Offline

Board footer

Powered by FluxBB