aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Wang <kaiw@FreeBSD.org>2010-07-21 09:56:42 +0000
committerKai Wang <kaiw@FreeBSD.org>2010-07-21 09:56:42 +0000
commit0e3c61d436655deaf3c4d176cdcdfa5b68a23179 (patch)
tree55f5431aa58e13a4a1b450ebaf8cdc88b9e7f00c
parent894afa87d62a8cf057b6e87336b1385c326a8221 (diff)
downloadsrc-0e3c61d436655deaf3c4d176cdcdfa5b68a23179.tar.gz
src-0e3c61d436655deaf3c4d176cdcdfa5b68a23179.zip
Changes for supporting GNU Hash sections.
Obtained from: elftoolchain MFC after: 1 month
Notes
Notes: svn path=/head/; revision=210332
-rw-r--r--lib/libelf/libelf_align.c14
-rw-r--r--lib/libelf/libelf_fsize.m41
-rw-r--r--lib/libelf/libelf_msize.m41
3 files changed, 14 insertions, 2 deletions
diff --git a/lib/libelf/libelf_align.c b/lib/libelf/libelf_align.c
index 94a82ab53f4c..870c9b76bf4c 100644
--- a/lib/libelf/libelf_align.c
+++ b/lib/libelf/libelf_align.c
@@ -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
diff --git a/lib/libelf/libelf_fsize.m4 b/lib/libelf/libelf_fsize.m4
index d9b11ec50cb8..83d6cbdc396e 100644
--- a/lib/libelf/libelf_fsize.m4
+++ b/lib/libelf/libelf_fsize.m4
@@ -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. */
diff --git a/lib/libelf/libelf_msize.m4 b/lib/libelf/libelf_msize.m4
index 3e735919251c..6ae6a485c5b0 100644
--- a/lib/libelf/libelf_msize.m4
+++ b/lib/libelf/libelf_msize.m4
@@ -49,6 +49,7 @@ divert(-1)
include(SRCDIR`/elf_types.m4')
define(BYTE_SIZE, 1)
+define(GNUHASH_SIZE, 1)
define(NOTE_SIZE, 1)
/*