"Elf" questions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
d4n1l0d
Member
Member
Posts: 42
Joined: Sat Dec 02, 2006 4:12 pm

"Elf" questions

Post by d4n1l0d »

What kind of binary file format is better to use?
I want one with recurses like the PE format, doesn't ELF has support for Icon, Bitmaps and stuff like that?
User avatar
Steve the Pirate
Member
Member
Posts: 152
Joined: Fri Dec 15, 2006 7:01 am
Location: Brisbane, Australia
Contact:

Post by Steve the Pirate »

Do you mean resources?

I'm not sure if you can by default, but I did find this in a quick google search: http://ktown.kde.org/~frerich/elfrc.html
My Site | My Blog
Symmetry - My operating system.
User avatar
Dandee Yuyo
Member
Member
Posts: 47
Joined: Fri Nov 09, 2007 6:46 pm
Location: Argentina

Post by Dandee Yuyo »

Those are not resources. Those are plain flat arrays exported...
NaN - Not a Nerd
Working on: Physical Memory Management with a 5-lod mipmap XD
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

ELF does not support windows-style "resources" because they are inherently GUI orientated, and ELF is an executable format - it has nothing to do with GUIs!

AFAIK most linux environments provide a list of custom icons that are 'assigned' to a particular file. Why do you need resources? I wouldn't let things like icons sway your decision on which file format to use because in all honesty, most osdevers never even get a GUI up and running.

If you're designing a windows-like system, with .dlls etc, use PE because it supports dlls.

If you're making a unix-like system with shared objects/libraries (.so) then use ELF because it supports shared objects.

I can't think of any situation where using a flat binary is advantageous.

You can always just make a format up yourself!
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

JamesM wrote:You can always just make a format up yourself!
Or modify an existing one - like adding a convention how resources are to be stored in ELF files :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
d4n1l0d
Member
Member
Posts: 42
Joined: Sat Dec 02, 2006 4:12 pm

Post by d4n1l0d »

Do you mean resources?

I'm not sure if you can by default, but I did find this in a quick google search: http://ktown.kde.org/~frerich/elfrc.html
oh, yeah... I was meaning resources =]


So... I guess that I'll have to make a modification of the ELF format....
That's not so good =//

Thank you everybody
and sorry for my poor english
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

JamesM wrote:If you're designing a windows-like system, with .dlls etc, use PE because it supports dlls.

If you're making a unix-like system with shared objects/libraries (.so) then use ELF because it supports shared objects.
That has got to be one of the least informed opinions I've read in any recent year. They're executable formats and they define chunks of memory to be loaded, addresses in that memory and lengths of blocks in that memory. That's all they do - DLLs are equal to SOs. The only difference is that the dynamic linked library for PE is called a DLL and a dynamic linked library for ELF is called an SO file.
User avatar
Dandee Yuyo
Member
Member
Posts: 47
Joined: Fri Nov 09, 2007 6:46 pm
Location: Argentina

Post by Dandee Yuyo »

Well, I have no experience with the ELF file format, however I read the spec.

One thing grabbed my attention: There's a mention of OpenGL copyright, but not mention of it in the rest of the document. :shock:

Anyway, it supports dynamic-linking. So you can declare your own '.res' (you name it) SHT_PROGBITS section with a neat table for resources.

Due to my experience with Windoze, Mac OSes, the game industry (where resources or "assets" are used all the time) and even with the BREW mobile platform, I have a clear idea of what I expect from "resources":

* Some predefined resource types, UTF-8 string tables, at least.
* The ability to define "custom" resource types
* The ability to enumerate them and know what they type is.
* Multilingual support

That's why I'm saying that this "rcelf" tool is not compiling resources, just embedding plain arrays.

a+;
NaN - Not a Nerd
Working on: Physical Memory Management with a 5-lod mipmap XD
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Candy wrote:
JamesM wrote:If you're designing a windows-like system, with .dlls etc, use PE because it supports dlls.

If you're making a unix-like system with shared objects/libraries (.so) then use ELF because it supports shared objects.
That has got to be one of the least informed opinions I've read in any recent year. They're executable formats and they define chunks of memory to be loaded, addresses in that memory and lengths of blocks in that memory. That's all they do - DLLs are equal to SOs. The only difference is that the dynamic linked library for PE is called a DLL and a dynamic linked library for ELF is called an SO file.
Why thank you! I have to admit, I don't know much about PE. I was lifting what I wrote directly from another thread (I forget which one) where people more informed than me were discussing it. IIRC (and possibly I don't) there were some windows-isms which were supported in PE but done differently in ELF.
User avatar
AndrewAPrice
Member
Member
Posts: 2309
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

I think, a program should not embed it's resources into it's executable file. (An exception is an installer which is convenient since you only have to distribute one file.)

I wouldn't embed icons into an executable file. I would place them in a seperate file and let my GUI manager let me assign icons to desktop and menu shortcuts which are stored in different files. I would much rather the icon in my file manager to be representative of the type of file (e.g. all programs have an icon of a cog (KDE) or a window (console programs in Windows)).
My OS is Perception.
TomTom
Posts: 23
Joined: Tue May 01, 2007 2:03 am
Location: USA

Post by TomTom »

Just like PE, ELF supports sections. In PE resources is just binary data in a regular section with a special name. It shouldn't be a problem accomplishing something similar using ELF.
Post Reply