You are not logged in.
Pages: 1
How can I get the optimization of a binary file (i686, i586, etc.)?
Fox
Offline
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
You can't.
Offline
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
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
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
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
But the binary itself can't be checked for its arch?
Fox
Offline
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:: / my web presence
Offline
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
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
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
Stats and fuzzy logic? Sounds like fuzzy math to me! 8)
Just out of curiousity, why?
Offline
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
Pages: 1