What happened to Elf64_Sxword?

walt wa1ter at myrealbox.com
Tue Dec 4 11:11:23 PST 2007

On Tue, 4 Dec 2007, Matthew Dillon wrote:

> :That value is defined in FreeBSD, NetBSD, OpenBSD, and linux, but not
> :in DFly.  Pkgsrc/devel/libelf won't build on DF because it's missing.
> :
> :Any particular reason to remove it?
>     I have no idea what Elf64_Sxword even is.  Some kind of structure or
>     elf type?  Where is it supposed to be defined?

I guess you didn't remove it, then :o)  Here is sys/elf64.h from DFly:

 * ELF definitions common to all 64-bit architectures.
typedef u_int64_t       Elf64_Addr;
typedef u_int32_t       Elf64_Half;
typedef u_int64_t       Elf64_Off;
typedef int64_t         Elf64_Sword;
typedef u_int64_t       Elf64_Word;
typedef u_int64_t       Elf64_Size;
typedef u_int16_t       Elf64_Quarter;
typedef Elf64_Half      Elf64_Hashelt;

And from FreeBSD 6:
typedef uint64_t        Elf64_Addr;
typedef uint16_t        Elf64_Half;
typedef uint64_t        Elf64_Off;
typedef int32_t         Elf64_Sword;
typedef int64_t         Elf64_Sxword;   <-----------
typedef uint32_t        Elf64_Word;
typedef uint64_t        Elf64_Xword;

And from linux:
typedef int32_t         Elf64_Sword;
typedef int64_t         Elf64_Sxword;

I notice that Sword was redefined from int32 to uint64 in DFly -- i.e. Sword
was redefined to the value of Sxword, which then leaves Sxword as redundant.

I'm no expert in any of this, but it seems like changing these 'industry
standard' definitions would be a bit dicey, no?

More information about the Bugs mailing list