Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jul 2010 09:56:42 +0000 (UTC)
From:      Kai Wang <kaiw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r210332 - head/lib/libelf
Message-ID:  <201007210956.o6L9ugTM081418@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kaiw
Date: Wed Jul 21 09:56:42 2010
New Revision: 210332
URL: http://svn.freebsd.org/changeset/base/210332

Log:
  Changes for supporting GNU Hash sections.
  
  Obtained from:	elftoolchain
  MFC after:		1 month

Modified:
  head/lib/libelf/libelf_align.c
  head/lib/libelf/libelf_fsize.m4
  head/lib/libelf/libelf_msize.m4

Modified: head/lib/libelf/libelf_align.c
==============================================================================
--- head/lib/libelf/libelf_align.c	Wed Jul 21 09:51:24 2010	(r210331)
+++ head/lib/libelf/libelf_align.c	Wed Jul 21 09:56:42 2010	(r210332)
@@ -51,6 +51,10 @@ struct align {
 		.a32 = 0,					\
 		.a64 = __alignof__(Elf64_##V)			\
 	}
+#define	MALIGN_WORD()	{					\
+		.a32 = __alignof__(int32_t),			\
+		.a64 = __alignof__(int64_t)			\
+	    }
 #else
 #error	Need the __alignof__ builtin.
 #endif
@@ -92,7 +96,10 @@ static struct align malign[ELF_T_NUM] = 
 	[ELF_T_VNEED]	= MALIGN(Verneed),
 #endif
 	[ELF_T_WORD]	= MALIGN(Word),
-	[ELF_T_XWORD]	= MALIGN64(Xword)
+	[ELF_T_XWORD]	= MALIGN64(Xword),
+#if	__FreeBSD_version >= 800062
+	[ELF_T_GNUHASH] = MALIGN_WORD()
+#endif
 };
 
 int
@@ -140,7 +147,10 @@ static struct align falign[ELF_T_NUM] = 
 	[ELF_T_VNEED]	= FALIGN(4,4),
 #endif
 	[ELF_T_WORD]	= FALIGN(4,4),
-	[ELF_T_XWORD]	= FALIGN(0,8)
+	[ELF_T_XWORD]	= FALIGN(0,8),
+#if	__FreeBSD_version >= 800062
+	[ELF_T_GNUHASH] = FALIGN(4,8)
+#endif
 };
 
 int

Modified: head/lib/libelf/libelf_fsize.m4
==============================================================================
--- head/lib/libelf/libelf_fsize.m4	Wed Jul 21 09:51:24 2010	(r210331)
+++ head/lib/libelf/libelf_fsize.m4	Wed Jul 21 09:56:42 2010	(r210332)
@@ -45,6 +45,7 @@ include(SRCDIR`/elf_types.m4')
 
 /* `Basic' types */
 define(`BYTE_SIZE',	1)
+define(`GNUHASH_SIZE',	1) /* Elf_GNU_Hash_Header structures vary in length. */
 define(`IDENT_SIZE',	`EI_NIDENT')
 define(`NOTE_SIZE',	1) /* Elf_Note structures have variable length. */
 

Modified: head/lib/libelf/libelf_msize.m4
==============================================================================
--- head/lib/libelf/libelf_msize.m4	Wed Jul 21 09:51:24 2010	(r210331)
+++ head/lib/libelf/libelf_msize.m4	Wed Jul 21 09:56:42 2010	(r210332)
@@ -49,6 +49,7 @@ divert(-1)
 include(SRCDIR`/elf_types.m4')
 
 define(BYTE_SIZE,	1)
+define(GNUHASH_SIZE,	1)
 define(NOTE_SIZE,	1)
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007210956.o6L9ugTM081418>