[haiku-development] Re: BeOS resources and strip

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 20 Apr 2009 17:47:21 +0200 CEST

>
> On 2009-04-20 at 17:18:44 [+0200], Grzegorz Dąbrowski
> <grzegorz.dabrowski@xxxxxxxxx> wrote:
> >
> > As I understand BeOS resources are appended to a ELF binary using
> > xres
> > command. Unfortunately the strip command (even strip --strip-debug)
> > removes them. Is it possible to workaround this?
>
> You mean besides not stripping it? No, since the resources are really
> just
> appended to the actual ELF file. They don't appear as section or
> segment in
> the ELF structure. We might want to change that someday, though.

or besides stripping before running xres.
For exemple the NetSurf target in the makefile :

$(EXETARGET): $(OBJECTS) $(RESOURCES)
        $(VQ)echo "    LINK: $(EXETARGET)"
ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
        $(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
else
        $(Q)$(CC) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
        $(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
        $(Q)$(RM) $(EXETARGET:,ff8=,e1f)
endif
ifeq ($(NETSURF_STRIP_BINARY),YES)
        $(VQ)echo "   STRIP: $(EXETARGET)"
        $(Q)$(STRIP) $(EXETARGET)
endif
ifeq ($(TARGET),beos)
        $(VQ)echo "    XRES: $(EXETARGET)"
        $(Q)$(BEOS_XRES) -o $(EXETARGET) $(RSRC_BEOS)
        $(VQ)echo "  SETVER: $(EXETARGET)"
        $(Q)$(BEOS_SETVER) $(EXETARGET) \
                -app $(VERSION_MAJ) $(VERSION_MIN) 0 d 0 \
                -short "NetSurf $(VERSION_FULL)" \
                -long "NetSurf $(VERSION_FULL) © 2003 - 2008 The
NetSurf Developers"
        $(VQ)echo " MIMESET: $(EXETARGET)"
        $(Q)$(BEOS_MIMESET) $(EXETARGET)
endif

Note EXE files in windows use a "next" field in the MZ header to link
to the PE header... not sure ELF has any such provision though...

François.

Other related posts: