[openbeos] Re: BeOS app resources in ELF

I don't see why it wouldn't
We just need to understand how to do it
Is it documented somewhere ?

With a rapid check in diskProbe, we see the resources seems to be located
at the end of the bin

I tried this:

[revol@patrick /boot/home]$ objcopy /boot/beos/apps/Magnify ./Mag_t
[revol@patrick /boot/home]$ ls -l /boot/beos/apps/Magnify
-rwxr-xr-x   1 revol    users      118892 Mar 24  2000 /boot/beos/apps/Magnify
[revol@patrick /boot/home]$ ls -l Mag_t
-rw-r--r--   1 revol    users      110671 Feb 21 23:30 Mag_t

(objcopy is a elf tool, it copies the elf sections, with optional symbol 
manipulation)

We see we loose the version info, which is stored as a resource:
[revol@patrick /boot/home]$ version -n /boot/beos/apps/Magnify
5 0 0 f 1
[revol@patrick /boot/home]$ version -n ./Mag_t
Version unknown!

We see also the elf section remain untouched:
[revol@patrick /boot/home]$ size /boot/beos/apps/Magnify
   text    data     bss     dec     hex filename
  73035   11548     520   85103   14c6f /boot/beos/apps/Magnify
[revol@patrick /boot/home]$ size ./Mag_t
   text    data     bss     dec     hex filename
  73035   11548     520   85103   14c6f ./Mag_t

The produced binary is totally functional, except it doesn't show the Magnify 
icon on the Deskbar.

Opening Magnify with DiskProbe, and jumping at offset 110671 (the end of 
Mag_t), we see the end of what seems to be the elf symbol, then a bunch of 0s,
then what seems to be an icon bitmap, the app signature, then some 0s again, 
then a table, with I understand as:

typedef struct resource_index_entry {
    uint32 id;
    uint16 name_sz; // the name string length
    char name[];    // the \0 terminated name
    uint64 offset;  // (offset_t) seems to be a negative offset,
                    // but from what ? end of file ?
} resource_index_entry;

Not sure if the table begins at EOF, or is read until EOF.

Ok, I won't go further, since it's noon, and I have my last exam tomorrow.
... That means I'll soon be able to get b4cK t0 c0dInG :)

François.

En réponse à Jonas Sundstrom <kirilla@xxxxxxxxx>:

> Does OBOS plan to support for ELF-embedded app resources?
> (BeOS-compatible)
> 
> /Jonas Sundström.                                   www.kirilla.com
> 
> 
> 





Other related posts: