Bug 3374

Summary: fcore core files are 64bit on a 32 bit platform
Product: frysk Reporter: Phil Muldoon <pmuldoon>
Component: generalAssignee: Phil Muldoon <pmuldoon>
Status: RESOLVED FIXED    
Severity: normal CC: zhengyo
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2243    

Description Phil Muldoon 2006-10-17 19:39:25 UTC
elf_begin is correctly called

gelf_newehdr(elf,gelf_getclass(elf)) might be incorrectly used as elf does not
know its own wordsize yet, so it may be returning 64bit always. We might have to
manually override the gelf_getclass() call and provide our own wordsize indicator
Comment 1 Phil Muldoon 2006-10-18 15:37:14 UTC
As suspected, using gelf_getclass() on an empty structure won't work (or
magically know what arch size you are on). When creating the Elf Header (and
only the Elf Header) with gelf a class has to be specified regarding ELFCLASS32
or ELFCLASS64. We can derive from wordsize which correct value to give to gelf
for initial header generation.

2006-10-17  Phil Muldoon  <pmuldoon@redhat.com>

        * Elf.java (createNewEHeader): Require a wordsize.

        * cni/Elf.cxx (elf_newehdr): Specify wordsize.
        gelf_getclass() for wordsize won't work on an empty elf struct.