summaryrefslogtreecommitdiffstats
path: root/lib/libelf/libelf_align.c
diff options
context:
space:
mode:
authorkaiw <kaiw@FreeBSD.org>2010-07-21 09:56:42 +0000
committerkaiw <kaiw@FreeBSD.org>2010-07-21 09:56:42 +0000
commit2e04fb95e19b0558696d09aadc16ca3c73c52ed2 (patch)
tree55f5431aa58e13a4a1b450ebaf8cdc88b9e7f00c /lib/libelf/libelf_align.c
parent090a9c2514dfe752abb7a13d7755ecfe29e3861d (diff)
downloadFreeBSD-src-2e04fb95e19b0558696d09aadc16ca3c73c52ed2.zip
FreeBSD-src-2e04fb95e19b0558696d09aadc16ca3c73c52ed2.tar.gz
Changes for supporting GNU Hash sections.
Obtained from: elftoolchain MFC after: 1 month
Diffstat (limited to 'lib/libelf/libelf_align.c')
-rw-r--r--lib/libelf/libelf_align.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libelf/libelf_align.c b/lib/libelf/libelf_align.c
index 94a82ab..870c9b7 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
OpenPOWER on IntegriCloud