summaryrefslogtreecommitdiffstats
path: root/libphobos
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-05-16 18:30:46 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2022-05-16 19:07:45 +0200
commit5eb9927aae076200bb7ba3f22c33b0a7c97c5643 (patch)
treef80210439a5d8995ebf189bce7f2e141fcb1caec /libphobos
parentlibstdc++: Fix hyperlink in docs (diff)
downloadgcc-5eb9927aae076200bb7ba3f22c33b0a7c97c5643.tar.gz
gcc-5eb9927aae076200bb7ba3f22c33b0a7c97c5643.tar.bz2
gcc-5eb9927aae076200bb7ba3f22c33b0a7c97c5643.tar.xz
d: Merge upstream dmd 60bfa0ee7, druntime 94bd5bcb, phobos 3a1cd9a01.
D front-end changes: - Import dmd v2.100.0. - Add bit fields to D, enabled via the -fpreview=bitfields switch. - Removed the -ftransition=markdown and -frevert=markdown switches. - Added new trait `__traits(classInstanceAlignment)' to provide the required data alignment for classes. - The check for `pragma(crt_constructor)' and `pragma(crt_destructor)' linkage has been relaxed to allow all `void()' signatures. - ImportC parser now recognizes the `typeof(...)' operator. D runtime changes: - Import druntime v2.100.0. Phobos changes: - Import phobos v2.100.0. - To comply with dip1000, `std.socket.Socket` methods now accept only `scope' arrays. - The `fill', `alignSize', `align2', and `align4' methods of `std.outbuffer.OutBuffer' have been extended to allow specifying a custom value when pre-filling or padding the buffer. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 60bfa0ee7. * dmd/VERSION: Update version to v2.100.0. * d-builtins.cc (d_init_versions): Update for new front-end interface. * d-codegen.cc (d_decl_context): Use resolvedLinkage to get declaration linkage. (build_struct_literal): Track offset in bits. * d-gimplify.cc (d_gimplify_modify_expr): Check both operands for a bit-field reference. * d-lang.cc (d_handle_option): Handle -fpreview=bitfields, remove -frevert=markdown and -ftransition=vmarkdown. (d_post_options): Set flag_rtti and flag_exceptions if -fno-druntime was seen on command-line. (d_parse_file): Update for new front-end interface. (d_type_promotes_to): Use resolvedLinkage to get declaration linkage. * decl.cc (make_thunk): Likewise. * expr.cc (ExprVisitor::visit (CatAssignExp *)): Remove lowering for appending of an element or array to another array. * lang.opt (fpreview=bitfields): New option. (frevert=markdown): Remove. (ftransition=vmarkdown): Remove. * types.cc (layout_aggregate_members): Ignore anonymous fields in total count. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 94bd5bcb. * libdruntime/Makefile.am (ALL_DRUNTIME_INSTALL_DSOURCES): Add $(DRUNTIME_DSOURCES_ELF). (ALL_DRUNTIME_SOURCES): Likewise. (DRUNTIME_DSOURCES_ELF): New variable. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos 3a1cd9a01. * testsuite/libphobos.init_fini/custom_gc.d: Update test.
Diffstat (limited to 'libphobos')
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/Makefile.am6
-rw-r--r--libphobos/libdruntime/Makefile.in132
-rw-r--r--libphobos/libdruntime/__builtins.di31
-rw-r--r--libphobos/libdruntime/core/internal/array/appending.d106
-rw-r--r--libphobos/libdruntime/core/internal/array/utils.d60
-rw-r--r--libphobos/libdruntime/core/internal/traits.d2
-rw-r--r--libphobos/libdruntime/core/lifetime.d13
-rw-r--r--libphobos/libdruntime/core/memory.d2
-rw-r--r--libphobos/libdruntime/core/simd.d24
-rw-r--r--libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d155
-rw-r--r--libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d154
-rw-r--r--libphobos/libdruntime/core/sys/dragonflybsd/sys/elf_common.d601
-rw-r--r--libphobos/libdruntime/core/sys/elf/package.d2532
-rw-r--r--libphobos/libdruntime/core/sys/freebsd/sys/elf32.d151
-rw-r--r--libphobos/libdruntime/core/sys/freebsd/sys/elf64.d159
-rw-r--r--libphobos/libdruntime/core/sys/freebsd/sys/elf_common.d803
-rw-r--r--libphobos/libdruntime/core/sys/linux/elf.d2419
-rw-r--r--libphobos/libdruntime/core/sys/netbsd/sys/elf32.d151
-rw-r--r--libphobos/libdruntime/core/sys/netbsd/sys/elf64.d150
-rw-r--r--libphobos/libdruntime/core/sys/netbsd/sys/elf_common.d758
-rw-r--r--libphobos/libdruntime/core/sys/openbsd/sys/elf32.d158
-rw-r--r--libphobos/libdruntime/core/sys/openbsd/sys/elf64.d157
-rw-r--r--libphobos/libdruntime/core/sys/openbsd/sys/elf_common.d604
-rw-r--r--libphobos/libdruntime/core/sys/posix/sys/socket.d33
-rw-r--r--libphobos/libdruntime/core/sys/solaris/sys/elf.d488
-rw-r--r--libphobos/libdruntime/core/sys/windows/objbase.d1
-rw-r--r--libphobos/libdruntime/core/sys/windows/unknwn.d1
-rw-r--r--libphobos/libdruntime/core/thread/osthread.d5
-rw-r--r--libphobos/libdruntime/core/thread/threadbase.d9
-rw-r--r--libphobos/libdruntime/object.d3
-rw-r--r--libphobos/libdruntime/rt/lifetime.d4
-rw-r--r--libphobos/src/MERGE2
-rw-r--r--libphobos/src/std/exception.d2
-rw-r--r--libphobos/src/std/experimental/logger/core.d8
-rw-r--r--libphobos/src/std/math/exponential.d4
-rw-r--r--libphobos/src/std/math/hardware.d4
-rw-r--r--libphobos/src/std/outbuffer.d71
-rw-r--r--libphobos/src/std/socket.d70
-rw-r--r--libphobos/src/std/sumtype.d23
-rw-r--r--libphobos/src/std/traits.d5
-rw-r--r--libphobos/src/std/typecons.d4
-rw-r--r--libphobos/testsuite/libphobos.init_fini/custom_gc.d3
43 files changed, 2959 insertions, 7111 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index c94634f4770..1a9faf9be04 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
1e361d200b287a68344095f306cf5ea3a63c080e1 194bd5bcb448405d90bc50113d1cfd45a0880a50d
2 2
3The first line of this file holds the git revision number of the last 3The first line of this file holds the git revision number of the last
4merge done from the dlang/druntime repository. 4merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am
index 6ca4012b713..260bb63340c 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -39,7 +39,7 @@ ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \
39 $(DRUNTIME_DSOURCES_OPENBSD) $(DRUNTIME_DSOURCES_POSIX) \ 39 $(DRUNTIME_DSOURCES_OPENBSD) $(DRUNTIME_DSOURCES_POSIX) \
40 $(DRUNTIME_DSOURCES_SOLARIS) $(DRUNTIME_DSOURCES_WINDOWS) \ 40 $(DRUNTIME_DSOURCES_SOLARIS) $(DRUNTIME_DSOURCES_WINDOWS) \
41 $(DRUNTIME_DSOURCES_GENERATED) $(DRUNTIME_DISOURCES) \ 41 $(DRUNTIME_DSOURCES_GENERATED) $(DRUNTIME_DISOURCES) \
42 $(DRUNTIME_DSOURCES_STDCXX) 42 $(DRUNTIME_DSOURCES_ELF) $(DRUNTIME_DSOURCES_STDCXX)
43 43
44# Setup source files depending on configure 44# Setup source files depending on configure
45DRUNTIME_SOURCES_CONFIGURED = 45DRUNTIME_SOURCES_CONFIGURED =
@@ -120,7 +120,7 @@ endif
120DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d 120DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d
121 121
122ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \ 122ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \
123 $(DRUNTIME_DSOURCES_STDCXX) \ 123 $(DRUNTIME_DSOURCES_ELF) $(DRUNTIME_DSOURCES_STDCXX) \
124 $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED) 124 $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED)
125 125
126# Need this library to both be part of libgphobos.a, and installed separately. 126# Need this library to both be part of libgphobos.a, and installed separately.
@@ -253,6 +253,8 @@ DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \
253 core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \ 253 core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \
254 core/sys/dragonflybsd/sys/sysctl.d core/sys/dragonflybsd/time.d 254 core/sys/dragonflybsd/sys/sysctl.d core/sys/dragonflybsd/time.d
255 255
256DRUNTIME_DSOURCES_ELF = core/sys/elf/package.d
257
256DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/config.d \ 258DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/config.d \
257 core/sys/freebsd/dlfcn.d core/sys/freebsd/err.d \ 259 core/sys/freebsd/dlfcn.d core/sys/freebsd/err.d \
258 core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \ 260 core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \
diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in
index f7f78d71ff7..b7e2f347278 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -245,13 +245,14 @@ am__objects_1 = core/atomic.lo core/attribute.lo core/bitop.lo \
245 rt/monitor_.lo rt/profilegc.lo rt/sections.lo rt/tlsgc.lo \ 245 rt/monitor_.lo rt/profilegc.lo rt/sections.lo rt/tlsgc.lo \
246 rt/util/typeinfo.lo rt/util/utility.lo 246 rt/util/typeinfo.lo rt/util/utility.lo
247am__objects_2 = core/stdc/libgdruntime_la-errno_.lo 247am__objects_2 = core/stdc/libgdruntime_la-errno_.lo
248am__objects_3 = core/stdcpp/allocator.lo core/stdcpp/array.lo \ 248am__objects_3 = core/sys/elf/package.lo
249am__objects_4 = core/stdcpp/allocator.lo core/stdcpp/array.lo \
249 core/stdcpp/exception.lo core/stdcpp/memory.lo \ 250 core/stdcpp/exception.lo core/stdcpp/memory.lo \
250 core/stdcpp/new_.lo core/stdcpp/string.lo \ 251 core/stdcpp/new_.lo core/stdcpp/string.lo \
251 core/stdcpp/string_view.lo core/stdcpp/type_traits.lo \ 252 core/stdcpp/string_view.lo core/stdcpp/type_traits.lo \
252 core/stdcpp/typeinfo.lo core/stdcpp/utility.lo \ 253 core/stdcpp/typeinfo.lo core/stdcpp/utility.lo \
253 core/stdcpp/vector.lo core/stdcpp/xutility.lo 254 core/stdcpp/vector.lo core/stdcpp/xutility.lo
254am__objects_4 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ 255am__objects_5 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \
255 core/sys/posix/config.lo core/sys/posix/dirent.lo \ 256 core/sys/posix/config.lo core/sys/posix/dirent.lo \
256 core/sys/posix/dlfcn.lo core/sys/posix/fcntl.lo \ 257 core/sys/posix/dlfcn.lo core/sys/posix/fcntl.lo \
257 core/sys/posix/grp.lo core/sys/posix/iconv.lo \ 258 core/sys/posix/grp.lo core/sys/posix/iconv.lo \
@@ -278,8 +279,8 @@ am__objects_4 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \
278 core/sys/posix/syslog.lo core/sys/posix/termios.lo \ 279 core/sys/posix/syslog.lo core/sys/posix/termios.lo \
279 core/sys/posix/time.lo core/sys/posix/ucontext.lo \ 280 core/sys/posix/time.lo core/sys/posix/ucontext.lo \
280 core/sys/posix/unistd.lo core/sys/posix/utime.lo 281 core/sys/posix/unistd.lo core/sys/posix/utime.lo
281@DRUNTIME_OS_POSIX_TRUE@am__objects_5 = $(am__objects_4) 282@DRUNTIME_OS_POSIX_TRUE@am__objects_6 = $(am__objects_5)
282am__objects_6 = core/sys/darwin/config.lo \ 283am__objects_7 = core/sys/darwin/config.lo \
283 core/sys/darwin/crt_externs.lo core/sys/darwin/dlfcn.lo \ 284 core/sys/darwin/crt_externs.lo core/sys/darwin/dlfcn.lo \
284 core/sys/darwin/err.lo core/sys/darwin/execinfo.lo \ 285 core/sys/darwin/err.lo core/sys/darwin/execinfo.lo \
285 core/sys/darwin/fcntl.lo core/sys/darwin/ifaddrs.lo \ 286 core/sys/darwin/fcntl.lo core/sys/darwin/ifaddrs.lo \
@@ -294,8 +295,8 @@ am__objects_6 = core/sys/darwin/config.lo \
294 core/sys/darwin/sys/attr.lo core/sys/darwin/sys/cdefs.lo \ 295 core/sys/darwin/sys/attr.lo core/sys/darwin/sys/cdefs.lo \
295 core/sys/darwin/sys/event.lo core/sys/darwin/sys/mman.lo \ 296 core/sys/darwin/sys/event.lo core/sys/darwin/sys/mman.lo \
296 core/sys/darwin/sys/sysctl.lo 297 core/sys/darwin/sys/sysctl.lo
297@DRUNTIME_OS_DARWIN_TRUE@am__objects_7 = $(am__objects_6) 298@DRUNTIME_OS_DARWIN_TRUE@am__objects_8 = $(am__objects_7)
298am__objects_8 = core/sys/dragonflybsd/dlfcn.lo \ 299am__objects_9 = core/sys/dragonflybsd/dlfcn.lo \
299 core/sys/dragonflybsd/err.lo core/sys/dragonflybsd/execinfo.lo \ 300 core/sys/dragonflybsd/err.lo core/sys/dragonflybsd/execinfo.lo \
300 core/sys/dragonflybsd/netinet/in_.lo \ 301 core/sys/dragonflybsd/netinet/in_.lo \
301 core/sys/dragonflybsd/pthread_np.lo \ 302 core/sys/dragonflybsd/pthread_np.lo \
@@ -314,12 +315,12 @@ am__objects_8 = core/sys/dragonflybsd/dlfcn.lo \
314 core/sys/dragonflybsd/sys/socket.lo \ 315 core/sys/dragonflybsd/sys/socket.lo \
315 core/sys/dragonflybsd/sys/sysctl.lo \ 316 core/sys/dragonflybsd/sys/sysctl.lo \
316 core/sys/dragonflybsd/time.lo 317 core/sys/dragonflybsd/time.lo
317@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__objects_9 = $(am__objects_8) 318@DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__objects_10 = $(am__objects_9)
318am__objects_10 = core/sys/bionic/err.lo core/sys/bionic/fcntl.lo \ 319am__objects_11 = core/sys/bionic/err.lo core/sys/bionic/fcntl.lo \
319 core/sys/bionic/stdlib.lo core/sys/bionic/string.lo \ 320 core/sys/bionic/stdlib.lo core/sys/bionic/string.lo \
320 core/sys/bionic/unistd.lo 321 core/sys/bionic/unistd.lo
321@DRUNTIME_OS_ANDROID_TRUE@am__objects_11 = $(am__objects_10) 322@DRUNTIME_OS_ANDROID_TRUE@am__objects_12 = $(am__objects_11)
322am__objects_12 = core/sys/freebsd/config.lo core/sys/freebsd/dlfcn.lo \ 323am__objects_13 = core/sys/freebsd/config.lo core/sys/freebsd/dlfcn.lo \
323 core/sys/freebsd/err.lo core/sys/freebsd/execinfo.lo \ 324 core/sys/freebsd/err.lo core/sys/freebsd/execinfo.lo \
324 core/sys/freebsd/netinet/in_.lo core/sys/freebsd/pthread_np.lo \ 325 core/sys/freebsd/netinet/in_.lo core/sys/freebsd/pthread_np.lo \
325 core/sys/freebsd/stdlib.lo core/sys/freebsd/string.lo \ 326 core/sys/freebsd/stdlib.lo core/sys/freebsd/string.lo \
@@ -332,8 +333,8 @@ am__objects_12 = core/sys/freebsd/config.lo core/sys/freebsd/dlfcn.lo \
332 core/sys/freebsd/sys/mman.lo core/sys/freebsd/sys/mount.lo \ 333 core/sys/freebsd/sys/mman.lo core/sys/freebsd/sys/mount.lo \
333 core/sys/freebsd/sys/sysctl.lo core/sys/freebsd/time.lo \ 334 core/sys/freebsd/sys/sysctl.lo core/sys/freebsd/time.lo \
334 core/sys/freebsd/unistd.lo 335 core/sys/freebsd/unistd.lo
335@DRUNTIME_OS_FREEBSD_TRUE@am__objects_13 = $(am__objects_12) 336@DRUNTIME_OS_FREEBSD_TRUE@am__objects_14 = $(am__objects_13)
336am__objects_14 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/err.lo \ 337am__objects_15 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/err.lo \
337 core/sys/netbsd/execinfo.lo core/sys/netbsd/stdlib.lo \ 338 core/sys/netbsd/execinfo.lo core/sys/netbsd/stdlib.lo \
338 core/sys/netbsd/string.lo core/sys/netbsd/sys/elf.lo \ 339 core/sys/netbsd/string.lo core/sys/netbsd/sys/elf.lo \
339 core/sys/netbsd/sys/elf32.lo core/sys/netbsd/sys/elf64.lo \ 340 core/sys/netbsd/sys/elf32.lo core/sys/netbsd/sys/elf64.lo \
@@ -341,8 +342,8 @@ am__objects_14 = core/sys/netbsd/dlfcn.lo core/sys/netbsd/err.lo \
341 core/sys/netbsd/sys/featuretest.lo \ 342 core/sys/netbsd/sys/featuretest.lo \
342 core/sys/netbsd/sys/link_elf.lo core/sys/netbsd/sys/mman.lo \ 343 core/sys/netbsd/sys/link_elf.lo core/sys/netbsd/sys/mman.lo \
343 core/sys/netbsd/sys/sysctl.lo core/sys/netbsd/time.lo 344 core/sys/netbsd/sys/sysctl.lo core/sys/netbsd/time.lo
344@DRUNTIME_OS_NETBSD_TRUE@am__objects_15 = $(am__objects_14) 345@DRUNTIME_OS_NETBSD_TRUE@am__objects_16 = $(am__objects_15)
345am__objects_16 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/err.lo \ 346am__objects_17 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/err.lo \
346 core/sys/openbsd/execinfo.lo core/sys/openbsd/pthread_np.lo \ 347 core/sys/openbsd/execinfo.lo core/sys/openbsd/pthread_np.lo \
347 core/sys/openbsd/pwd.lo core/sys/openbsd/stdlib.lo \ 348 core/sys/openbsd/pwd.lo core/sys/openbsd/stdlib.lo \
348 core/sys/openbsd/string.lo core/sys/openbsd/sys/cdefs.lo \ 349 core/sys/openbsd/string.lo core/sys/openbsd/sys/cdefs.lo \
@@ -352,8 +353,8 @@ am__objects_16 = core/sys/openbsd/dlfcn.lo core/sys/openbsd/err.lo \
352 core/sys/openbsd/sys/link_elf.lo core/sys/openbsd/sys/mman.lo \ 353 core/sys/openbsd/sys/link_elf.lo core/sys/openbsd/sys/mman.lo \
353 core/sys/openbsd/sys/sysctl.lo core/sys/openbsd/time.lo \ 354 core/sys/openbsd/sys/sysctl.lo core/sys/openbsd/time.lo \
354 core/sys/openbsd/unistd.lo 355 core/sys/openbsd/unistd.lo
355@DRUNTIME_OS_OPENBSD_TRUE@am__objects_17 = $(am__objects_16) 356@DRUNTIME_OS_OPENBSD_TRUE@am__objects_18 = $(am__objects_17)
356am__objects_18 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \ 357am__objects_19 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \
357 core/sys/linux/elf.lo core/sys/linux/epoll.lo \ 358 core/sys/linux/elf.lo core/sys/linux/epoll.lo \
358 core/sys/linux/err.lo core/sys/linux/errno.lo \ 359 core/sys/linux/err.lo core/sys/linux/errno.lo \
359 core/sys/linux/execinfo.lo core/sys/linux/fcntl.lo \ 360 core/sys/linux/execinfo.lo core/sys/linux/fcntl.lo \
@@ -371,8 +372,8 @@ am__objects_18 = core/sys/linux/config.lo core/sys/linux/dlfcn.lo \
371 core/sys/linux/termios.lo core/sys/linux/time.lo \ 372 core/sys/linux/termios.lo core/sys/linux/time.lo \
372 core/sys/linux/timerfd.lo core/sys/linux/tipc.lo \ 373 core/sys/linux/timerfd.lo core/sys/linux/tipc.lo \
373 core/sys/linux/unistd.lo 374 core/sys/linux/unistd.lo
374@DRUNTIME_OS_LINUX_TRUE@am__objects_19 = $(am__objects_18) 375@DRUNTIME_OS_LINUX_TRUE@am__objects_20 = $(am__objects_19)
375am__objects_20 = core/sys/windows/accctrl.lo \ 376am__objects_21 = core/sys/windows/accctrl.lo \
376 core/sys/windows/aclapi.lo core/sys/windows/aclui.lo \ 377 core/sys/windows/aclapi.lo core/sys/windows/aclui.lo \
377 core/sys/windows/basetsd.lo core/sys/windows/basetyps.lo \ 378 core/sys/windows/basetsd.lo core/sys/windows/basetyps.lo \
378 core/sys/windows/cderr.lo core/sys/windows/cguid.lo \ 379 core/sys/windows/cderr.lo core/sys/windows/cguid.lo \
@@ -457,9 +458,9 @@ am__objects_20 = core/sys/windows/accctrl.lo \
457 core/sys/windows/winsvc.lo core/sys/windows/winuser.lo \ 458 core/sys/windows/winsvc.lo core/sys/windows/winuser.lo \
458 core/sys/windows/winver.lo core/sys/windows/wtsapi32.lo \ 459 core/sys/windows/winver.lo core/sys/windows/wtsapi32.lo \
459 core/sys/windows/wtypes.lo 460 core/sys/windows/wtypes.lo
460@DRUNTIME_OS_MINGW_TRUE@am__objects_21 = $(am__objects_20) \ 461@DRUNTIME_OS_MINGW_TRUE@am__objects_22 = $(am__objects_21) \
461@DRUNTIME_OS_MINGW_TRUE@ config/mingw/libgdruntime_la-msvc.lo 462@DRUNTIME_OS_MINGW_TRUE@ config/mingw/libgdruntime_la-msvc.lo
462am__objects_22 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ 463am__objects_23 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \
463 core/sys/solaris/err.lo core/sys/solaris/execinfo.lo \ 464 core/sys/solaris/err.lo core/sys/solaris/execinfo.lo \
464 core/sys/solaris/libelf.lo core/sys/solaris/link.lo \ 465 core/sys/solaris/libelf.lo core/sys/solaris/link.lo \
465 core/sys/solaris/stdlib.lo core/sys/solaris/sys/elf.lo \ 466 core/sys/solaris/stdlib.lo core/sys/solaris/sys/elf.lo \
@@ -471,48 +472,48 @@ am__objects_22 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \
471 core/sys/solaris/sys/priocntl.lo \ 472 core/sys/solaris/sys/priocntl.lo \
472 core/sys/solaris/sys/procset.lo core/sys/solaris/sys/types.lo \ 473 core/sys/solaris/sys/procset.lo core/sys/solaris/sys/types.lo \
473 core/sys/solaris/time.lo 474 core/sys/solaris/time.lo
474@DRUNTIME_OS_SOLARIS_TRUE@am__objects_23 = $(am__objects_22) 475@DRUNTIME_OS_SOLARIS_TRUE@am__objects_24 = $(am__objects_23)
475@DRUNTIME_CPU_AARCH64_TRUE@am__objects_24 = config/aarch64/libgdruntime_la-switchcontext.lo 476@DRUNTIME_CPU_AARCH64_TRUE@am__objects_25 = config/aarch64/libgdruntime_la-switchcontext.lo
476@DRUNTIME_CPU_ARM_TRUE@am__objects_25 = config/arm/libgdruntime_la-switchcontext.lo 477@DRUNTIME_CPU_ARM_TRUE@am__objects_26 = config/arm/libgdruntime_la-switchcontext.lo
477@DRUNTIME_CPU_MIPS_TRUE@am__objects_26 = config/mips/libgdruntime_la-switchcontext.lo 478@DRUNTIME_CPU_MIPS_TRUE@am__objects_27 = config/mips/libgdruntime_la-switchcontext.lo
478@DRUNTIME_CPU_POWERPC_TRUE@am__objects_27 = config/powerpc/libgdruntime_la-switchcontext.lo 479@DRUNTIME_CPU_POWERPC_TRUE@am__objects_28 = config/powerpc/libgdruntime_la-switchcontext.lo
479@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_28 = config/mingw/libgdruntime_la-switchcontext.lo 480@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_29 = config/mingw/libgdruntime_la-switchcontext.lo
480@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_29 = config/x86/libgdruntime_la-switchcontext.lo 481@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_30 = config/x86/libgdruntime_la-switchcontext.lo
481@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_30 = config/systemz/libgdruntime_la-get_tls_offset.lo 482@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_31 = config/systemz/libgdruntime_la-get_tls_offset.lo
482@DRUNTIME_CPU_S390_TRUE@am__objects_31 = config/s390/libgdruntime_la-get_tls_offset.lo 483@DRUNTIME_CPU_S390_TRUE@am__objects_32 = config/s390/libgdruntime_la-get_tls_offset.lo
483am__objects_32 = $(am__objects_5) $(am__objects_7) $(am__objects_9) \ 484am__objects_33 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \
484 $(am__objects_11) $(am__objects_13) $(am__objects_15) \ 485 $(am__objects_12) $(am__objects_14) $(am__objects_16) \
485 $(am__objects_17) $(am__objects_19) $(am__objects_21) \ 486 $(am__objects_18) $(am__objects_20) $(am__objects_22) \
486 $(am__objects_23) $(am__objects_24) $(am__objects_25) \ 487 $(am__objects_24) $(am__objects_25) $(am__objects_26) \
487 $(am__objects_26) $(am__objects_27) $(am__objects_28) \ 488 $(am__objects_27) $(am__objects_28) $(am__objects_29) \
488 $(am__objects_29) $(am__objects_30) $(am__objects_31) 489 $(am__objects_30) $(am__objects_31) $(am__objects_32)
489am__objects_33 = gcc/config.lo gcc/libbacktrace.lo 490am__objects_34 = gcc/config.lo gcc/libbacktrace.lo
490am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ 491am__objects_35 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
491 $(am__objects_32) $(am__objects_33) 492 $(am__objects_4) $(am__objects_33) $(am__objects_34)
492am_libgdruntime_la_OBJECTS = $(am__objects_34) 493am_libgdruntime_la_OBJECTS = $(am__objects_35)
493libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS) 494libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS)
494am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) 495am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
495am__objects_35 = core/stdc/libgdruntime_convenience_la-errno_.lo 496am__objects_36 = core/stdc/libgdruntime_convenience_la-errno_.lo
496@DRUNTIME_OS_MINGW_TRUE@am__objects_36 = $(am__objects_20) \ 497@DRUNTIME_OS_MINGW_TRUE@am__objects_37 = $(am__objects_21) \
497@DRUNTIME_OS_MINGW_TRUE@ config/mingw/libgdruntime_convenience_la-msvc.lo 498@DRUNTIME_OS_MINGW_TRUE@ config/mingw/libgdruntime_convenience_la-msvc.lo
498@DRUNTIME_CPU_AARCH64_TRUE@am__objects_37 = config/aarch64/libgdruntime_convenience_la-switchcontext.lo 499@DRUNTIME_CPU_AARCH64_TRUE@am__objects_38 = config/aarch64/libgdruntime_convenience_la-switchcontext.lo
499@DRUNTIME_CPU_ARM_TRUE@am__objects_38 = config/arm/libgdruntime_convenience_la-switchcontext.lo 500@DRUNTIME_CPU_ARM_TRUE@am__objects_39 = config/arm/libgdruntime_convenience_la-switchcontext.lo
500@DRUNTIME_CPU_MIPS_TRUE@am__objects_39 = config/mips/libgdruntime_convenience_la-switchcontext.lo 501@DRUNTIME_CPU_MIPS_TRUE@am__objects_40 = config/mips/libgdruntime_convenience_la-switchcontext.lo
501@DRUNTIME_CPU_POWERPC_TRUE@am__objects_40 = config/powerpc/libgdruntime_convenience_la-switchcontext.lo 502@DRUNTIME_CPU_POWERPC_TRUE@am__objects_41 = config/powerpc/libgdruntime_convenience_la-switchcontext.lo
502@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_41 = config/mingw/libgdruntime_convenience_la-switchcontext.lo 503@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_42 = config/mingw/libgdruntime_convenience_la-switchcontext.lo
503@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_42 = config/x86/libgdruntime_convenience_la-switchcontext.lo 504@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_43 = config/x86/libgdruntime_convenience_la-switchcontext.lo
504@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_43 = config/systemz/libgdruntime_convenience_la-get_tls_offset.lo 505@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_44 = config/systemz/libgdruntime_convenience_la-get_tls_offset.lo
505@DRUNTIME_CPU_S390_TRUE@am__objects_44 = config/s390/libgdruntime_convenience_la-get_tls_offset.lo 506@DRUNTIME_CPU_S390_TRUE@am__objects_45 = config/s390/libgdruntime_convenience_la-get_tls_offset.lo
506am__objects_45 = $(am__objects_5) $(am__objects_7) $(am__objects_9) \ 507am__objects_46 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \
507 $(am__objects_11) $(am__objects_13) $(am__objects_15) \ 508 $(am__objects_12) $(am__objects_14) $(am__objects_16) \
508 $(am__objects_17) $(am__objects_19) $(am__objects_36) \ 509 $(am__objects_18) $(am__objects_20) $(am__objects_37) \
509 $(am__objects_23) $(am__objects_37) $(am__objects_38) \ 510 $(am__objects_24) $(am__objects_38) $(am__objects_39) \
510 $(am__objects_39) $(am__objects_40) $(am__objects_41) \ 511 $(am__objects_40) $(am__objects_41) $(am__objects_42) \
511 $(am__objects_42) $(am__objects_43) $(am__objects_44) 512 $(am__objects_43) $(am__objects_44) $(am__objects_45)
512am__objects_46 = $(am__objects_1) $(am__objects_35) $(am__objects_3) \ 513am__objects_47 = $(am__objects_1) $(am__objects_36) $(am__objects_3) \
513 $(am__objects_45) $(am__objects_33) 514 $(am__objects_4) $(am__objects_46) $(am__objects_34)
514am__objects_47 = $(am__objects_46) 515am__objects_48 = $(am__objects_47)
515am_libgdruntime_convenience_la_OBJECTS = $(am__objects_47) 516am_libgdruntime_convenience_la_OBJECTS = $(am__objects_48)
516libgdruntime_convenience_la_OBJECTS = \ 517libgdruntime_convenience_la_OBJECTS = \
517 $(am_libgdruntime_convenience_la_OBJECTS) 518 $(am_libgdruntime_convenience_la_OBJECTS)
518AM_V_P = $(am__v_P_@AM_V@) 519AM_V_P = $(am__v_P_@AM_V@)
@@ -777,7 +778,7 @@ ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \
777 $(DRUNTIME_DSOURCES_OPENBSD) $(DRUNTIME_DSOURCES_POSIX) \ 778 $(DRUNTIME_DSOURCES_OPENBSD) $(DRUNTIME_DSOURCES_POSIX) \
778 $(DRUNTIME_DSOURCES_SOLARIS) $(DRUNTIME_DSOURCES_WINDOWS) \ 779 $(DRUNTIME_DSOURCES_SOLARIS) $(DRUNTIME_DSOURCES_WINDOWS) \
779 $(DRUNTIME_DSOURCES_GENERATED) $(DRUNTIME_DISOURCES) \ 780 $(DRUNTIME_DSOURCES_GENERATED) $(DRUNTIME_DISOURCES) \
780 $(DRUNTIME_DSOURCES_STDCXX) 781 $(DRUNTIME_DSOURCES_ELF) $(DRUNTIME_DSOURCES_STDCXX)
781 782
782 783
783# Setup source files depending on configure 784# Setup source files depending on configure
@@ -796,7 +797,7 @@ DRUNTIME_SOURCES_CONFIGURED = $(am__append_1) $(am__append_2) \
796# Generated by configure 797# Generated by configure
797DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d 798DRUNTIME_DSOURCES_GENERATED = gcc/config.d gcc/libbacktrace.d
798ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \ 799ALL_DRUNTIME_SOURCES = $(DRUNTIME_DSOURCES) $(DRUNTIME_CSOURCES) \
799 $(DRUNTIME_DSOURCES_STDCXX) \ 800 $(DRUNTIME_DSOURCES_ELF) $(DRUNTIME_DSOURCES_STDCXX) \
800 $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED) 801 $(DRUNTIME_SOURCES_CONFIGURED) $(DRUNTIME_DSOURCES_GENERATED)
801 802
802 803
@@ -918,6 +919,7 @@ DRUNTIME_DSOURCES_DRAGONFLYBSD = core/sys/dragonflybsd/dlfcn.d \
918 core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \ 919 core/sys/dragonflybsd/sys/mman.d core/sys/dragonflybsd/sys/socket.d \
919 core/sys/dragonflybsd/sys/sysctl.d core/sys/dragonflybsd/time.d 920 core/sys/dragonflybsd/sys/sysctl.d core/sys/dragonflybsd/time.d
920 921
922DRUNTIME_DSOURCES_ELF = core/sys/elf/package.d
921DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/config.d \ 923DRUNTIME_DSOURCES_FREEBSD = core/sys/freebsd/config.d \
922 core/sys/freebsd/dlfcn.d core/sys/freebsd/err.d \ 924 core/sys/freebsd/dlfcn.d core/sys/freebsd/err.d \
923 core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \ 925 core/sys/freebsd/execinfo.d core/sys/freebsd/netinet/in_.d \
@@ -1374,6 +1376,10 @@ rt/util/$(am__dirstamp):
1374rt/util/typeinfo.lo: rt/util/$(am__dirstamp) 1376rt/util/typeinfo.lo: rt/util/$(am__dirstamp)
1375rt/util/utility.lo: rt/util/$(am__dirstamp) 1377rt/util/utility.lo: rt/util/$(am__dirstamp)
1376core/stdc/libgdruntime_la-errno_.lo: core/stdc/$(am__dirstamp) 1378core/stdc/libgdruntime_la-errno_.lo: core/stdc/$(am__dirstamp)
1379core/sys/elf/$(am__dirstamp):
1380 @$(MKDIR_P) core/sys/elf
1381 @: > core/sys/elf/$(am__dirstamp)
1382core/sys/elf/package.lo: core/sys/elf/$(am__dirstamp)
1377core/stdcpp/$(am__dirstamp): 1383core/stdcpp/$(am__dirstamp):
1378 @$(MKDIR_P) core/stdcpp 1384 @$(MKDIR_P) core/stdcpp
1379 @: > core/stdcpp/$(am__dirstamp) 1385 @: > core/stdcpp/$(am__dirstamp)
@@ -2016,6 +2022,8 @@ mostlyclean-compile:
2016 -rm -f core/sys/dragonflybsd/netinet/*.lo 2022 -rm -f core/sys/dragonflybsd/netinet/*.lo
2017 -rm -f core/sys/dragonflybsd/sys/*.$(OBJEXT) 2023 -rm -f core/sys/dragonflybsd/sys/*.$(OBJEXT)
2018 -rm -f core/sys/dragonflybsd/sys/*.lo 2024 -rm -f core/sys/dragonflybsd/sys/*.lo
2025 -rm -f core/sys/elf/*.$(OBJEXT)
2026 -rm -f core/sys/elf/*.lo
2019 -rm -f core/sys/freebsd/*.$(OBJEXT) 2027 -rm -f core/sys/freebsd/*.$(OBJEXT)
2020 -rm -f core/sys/freebsd/*.lo 2028 -rm -f core/sys/freebsd/*.lo
2021 -rm -f core/sys/freebsd/netinet/*.$(OBJEXT) 2029 -rm -f core/sys/freebsd/netinet/*.$(OBJEXT)
@@ -2184,6 +2192,7 @@ clean-libtool:
2184 -rm -rf core/sys/dragonflybsd/.libs core/sys/dragonflybsd/_libs 2192 -rm -rf core/sys/dragonflybsd/.libs core/sys/dragonflybsd/_libs
2185 -rm -rf core/sys/dragonflybsd/netinet/.libs core/sys/dragonflybsd/netinet/_libs 2193 -rm -rf core/sys/dragonflybsd/netinet/.libs core/sys/dragonflybsd/netinet/_libs
2186 -rm -rf core/sys/dragonflybsd/sys/.libs core/sys/dragonflybsd/sys/_libs 2194 -rm -rf core/sys/dragonflybsd/sys/.libs core/sys/dragonflybsd/sys/_libs
2195 -rm -rf core/sys/elf/.libs core/sys/elf/_libs
2187 -rm -rf core/sys/freebsd/.libs core/sys/freebsd/_libs 2196 -rm -rf core/sys/freebsd/.libs core/sys/freebsd/_libs
2188 -rm -rf core/sys/freebsd/netinet/.libs core/sys/freebsd/netinet/_libs 2197 -rm -rf core/sys/freebsd/netinet/.libs core/sys/freebsd/netinet/_libs
2189 -rm -rf core/sys/freebsd/sys/.libs core/sys/freebsd/sys/_libs 2198 -rm -rf core/sys/freebsd/sys/.libs core/sys/freebsd/sys/_libs
@@ -2345,6 +2354,7 @@ distclean-generic:
2345 -rm -f core/sys/dragonflybsd/$(am__dirstamp) 2354 -rm -f core/sys/dragonflybsd/$(am__dirstamp)
2346 -rm -f core/sys/dragonflybsd/netinet/$(am__dirstamp) 2355 -rm -f core/sys/dragonflybsd/netinet/$(am__dirstamp)
2347 -rm -f core/sys/dragonflybsd/sys/$(am__dirstamp) 2356 -rm -f core/sys/dragonflybsd/sys/$(am__dirstamp)
2357 -rm -f core/sys/elf/$(am__dirstamp)
2348 -rm -f core/sys/freebsd/$(am__dirstamp) 2358 -rm -f core/sys/freebsd/$(am__dirstamp)
2349 -rm -f core/sys/freebsd/netinet/$(am__dirstamp) 2359 -rm -f core/sys/freebsd/netinet/$(am__dirstamp)
2350 -rm -f core/sys/freebsd/sys/$(am__dirstamp) 2360 -rm -f core/sys/freebsd/sys/$(am__dirstamp)
diff --git a/libphobos/libdruntime/__builtins.di b/libphobos/libdruntime/__builtins.di
index e5c448e00cf..cf05333429e 100644
--- a/libphobos/libdruntime/__builtins.di
+++ b/libphobos/libdruntime/__builtins.di
@@ -19,25 +19,23 @@ module __builtins;
19 * into the D compiler. 19 * into the D compiler.
20 */ 20 */
21 21
22import core.stdc.stdarg; 22alias va_list = imported!"core.stdc.stdarg".va_list;
23
24alias va_list = core.stdc.stdarg.va_list;
25 23
26version (Posix) 24version (Posix)
27{ 25{
28 version (X86_64) 26 version (X86_64)
29 alias __va_list_tag = core.stdc.stdarg.__va_list_tag; 27 alias __va_list_tag = imported!"core.stdc.stdarg".__va_list_tag;
30} 28}
31 29
32alias __builtin_va_start = core.stdc.stdarg.va_start; 30alias __builtin_va_start = imported!"core.stdc.stdarg".va_start;
33 31
34alias __builtin_va_end = core.stdc.stdarg.va_end; 32alias __builtin_va_end = imported!"core.stdc.stdarg".va_end;
35 33
36alias __builtin_va_copy = core.stdc.stdarg.va_copy; 34alias __builtin_va_copy = imported!"core.stdc.stdarg".va_copy;
37 35
38/* dmd's ImportC rewrites __builtin_va_arg into an instantiation of va_arg 36/* dmd's ImportC rewrites __builtin_va_arg into an instantiation of va_arg
39 */ 37 */
40alias va_arg = core.stdc.stdarg.va_arg; 38alias va_arg = imported!"core.stdc.stdarg".va_arg;
41 39
42version (CRuntime_Microsoft) 40version (CRuntime_Microsoft)
43{ 41{
@@ -63,11 +61,9 @@ version (DigitalMars)
63 alias __builtin_huge_valf = __builtin_inff; 61 alias __builtin_huge_valf = __builtin_inff;
64 alias __builtin_huge_vall = __builtin_infl; 62 alias __builtin_huge_vall = __builtin_infl;
65 63
66 import core.stdc.math; 64 alias __builtin_fabs = imported!"core.stdc.math".fabs;
67 65 alias __builtin_fabsf = imported!"core.stdc.math".fabsf;
68 alias __builtin_fabs = core.stdc.math.fabs; 66 alias __builtin_fabsl = imported!"core.stdc.math".fabsl;
69 alias __builtin_fabsf = core.stdc.math.fabsf;
70 alias __builtin_fabsl = core.stdc.math.fabsl;
71 67
72 ushort __builtin_bswap16()(ushort value) 68 ushort __builtin_bswap16()(ushort value)
73 { 69 {
@@ -87,10 +83,13 @@ version (DigitalMars)
87 return core.bitop.bswap(value); 83 return core.bitop.bswap(value);
88 } 84 }
89 85
86 // Lazily imported on first use
87 private alias c_long = imported!"core.stdc.config".c_long;
88
90 // Stub these out to no-ops 89 // Stub these out to no-ops
91 int __builtin_constant_p(T)(T exp) { return 0; } // should be something like __traits(compiles, enum X = expr) 90 int __builtin_constant_p(T)(T exp) { return 0; } // should be something like __traits(compiles, enum X = expr)
92 long __builtin_expect()(long exp, long c) { return exp; } 91 c_long __builtin_expect()(c_long exp, c_long c) { return exp; }
93 void* __builtin_assume_aligned()(const void* p, size_t align_, ...) { return cast(void*)p; } 92 void* __builtin_assume_aligned()(const void* p, size_t align_, ...) { return cast(void*)p; }
94 93
95 // https://releases.llvm.org/13.0.0/tools/clang/docs/LanguageExtensions.html#builtin-assume 94 // https://releases.llvm.org/13.0.0/tools/clang/docs/LanguageExtensions.html#builtin-assume
96 void __builtin_assume(T)(lazy T arg) { } 95 void __builtin_assume(T)(lazy T arg) { }
diff --git a/libphobos/libdruntime/core/internal/array/appending.d b/libphobos/libdruntime/core/internal/array/appending.d
index 172263c684a..5d4f3b498f9 100644
--- a/libphobos/libdruntime/core/internal/array/appending.d
+++ b/libphobos/libdruntime/core/internal/array/appending.d
@@ -76,79 +76,55 @@ template _d_arrayappendcTXImpl(Tarr : T[], T)
76 alias _d_arrayappendcTXTrace = _d_HookTraceImpl!(Tarr, _d_arrayappendcTX, errorMessage); 76 alias _d_arrayappendcTXTrace = _d_HookTraceImpl!(Tarr, _d_arrayappendcTX, errorMessage);
77} 77}
78 78
79/// Implementation of `_d_arrayappendT` and `_d_arrayappendTTrace` 79/// Implementation of `_d_arrayappendT`
80template _d_arrayappendTImpl(Tarr : T[], T) 80ref Tarr _d_arrayappendT(Tarr : T[], T)(return ref scope Tarr x, scope Tarr y) @trusted
81{ 81{
82 import core.internal.array.utils : _d_HookTraceImpl; 82 pragma(inline, false);
83
84 private enum errorMessage = "Cannot append to array if compiling without support for runtime type information!";
85
86 /**
87 * Append array `y` to array `x`.
88 * Params:
89 * x = what array to append to, taken as a reference
90 * y = what should be appended
91 * Returns:
92 * The new value of `x`
93 * Bugs:
94 * This function template was ported from a much older runtime hook that bypassed safety,
95 * purity, and throwabilty checks. To prevent breaking existing code, this function template
96 * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
97 */
98 static if (isCopyingNothrow!T)
99 ref Tarr _d_arrayappendT(return ref scope Tarr x, scope Tarr y) @trusted pure nothrow
100 {
101 pragma(inline, false);
102 83
103 mixin(_d_arrayappendTBody); 84 import core.stdc.string : memcpy;
104 } 85 import core.internal.traits : hasElaborateCopyConstructor, Unqual;
105 else 86 import core.lifetime : copyEmplace;
106 ref Tarr _d_arrayappendT(return ref scope Tarr x, scope Tarr y) @trusted pure
107 {
108 pragma(inline, false);
109
110 mixin(_d_arrayappendTBody);
111 }
112 87
113 private enum _d_arrayappendTBody = q{ 88 auto length = x.length;
114 import core.stdc.string : memcpy;
115 import core.internal.traits : hasElaborateCopyConstructor, Unqual;
116 import core.lifetime : copyEmplace;
117 89
118 auto length = x.length; 90 _d_arrayappendcTXImpl!Tarr._d_arrayappendcTX(x, y.length);
119 91
120 _d_arrayappendcTXImpl!Tarr._d_arrayappendcTX(x, y.length); 92 static if (hasElaborateCopyConstructor!T)
93 {
94 foreach (i, ref elem; y)
95 copyEmplace(elem, x[length + i]);
96 }
97 else
98 {
99 // blit all elements at once
100 if (y.length)
101 memcpy(cast(Unqual!T *)&x[length], cast(Unqual!T *)&y[0], y.length * T.sizeof);
102 }
121 103
122 static if (hasElaborateCopyConstructor!T) 104 return x;
123 { 105}
124 foreach (i; 0 .. y.length)
125 copyEmplace(y[i], x[length + i]);
126 }
127 else
128 {
129 // blit all elements at once
130 if (y.length)
131 memcpy(cast(Unqual!T *)&x[length], cast(Unqual!T *)&y[0], y.length * T.sizeof);
132 }
133 106
134 return x; 107/**
135 }; 108 * TraceGC wrapper around $(REF _d_arrayappendT, core,internal,array,appending).
109 */
110ref Tarr _d_arrayappendTTrace(Tarr : T[], T)(string file, int line, string funcname, return ref scope Tarr x, scope Tarr y) @trusted
111{
112 version (D_TypeInfo)
113 {
114 import core.internal.array.utils: TraceHook, gcStatsPure, accumulatePure;
115 mixin(TraceHook!(Tarr.stringof, "_d_arrayappendT"));
136 116
137 /** 117 return _d_arrayappendT(x, y);
138 * TraceGC wrapper around $(REF _d_arrayappendT, rt,array,appending,_d_arrayappendTImpl). 118 }
139 * Bugs: 119 else
140 * This function template was ported from a much older runtime hook that bypassed safety, 120 assert(0, "Cannot append to array if compiling without support for runtime type information!");
141 * purity, and throwabilty checks. To prevent breaking existing code, this function template
142 * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
143 */
144 alias _d_arrayappendTTrace = _d_HookTraceImpl!(Tarr, _d_arrayappendT, errorMessage);
145} 121}
146 122
147@safe unittest 123@safe unittest
148{ 124{
149 double[] arr1; 125 double[] arr1;
150 foreach (i; 0 .. 4) 126 foreach (i; 0 .. 4)
151 _d_arrayappendTImpl!(typeof(arr1))._d_arrayappendT(arr1, [cast(double)i]); 127 _d_arrayappendT(arr1, [cast(double)i]);
152 assert(arr1 == [0.0, 1.0, 2.0, 3.0]); 128 assert(arr1 == [0.0, 1.0, 2.0, 3.0]);
153} 129}
154 130
@@ -167,7 +143,7 @@ template _d_arrayappendTImpl(Tarr : T[], T)
167 Item[] arr2 = [Item(), Item()]; 143 Item[] arr2 = [Item(), Item()];
168 Item[] arr1_org = [Item(), Item()]; 144 Item[] arr1_org = [Item(), Item()];
169 arr1_org ~= arr2; 145 arr1_org ~= arr2;
170 _d_arrayappendTImpl!(typeof(arr1))._d_arrayappendT(arr1, arr2); 146 _d_arrayappendT(arr1, arr2);
171 147
172 // postblit should have triggered on at least the items in arr2 148 // postblit should have triggered on at least the items in arr2
173 assert(blitted >= arr2.length); 149 assert(blitted >= arr2.length);
@@ -187,7 +163,7 @@ template _d_arrayappendTImpl(Tarr : T[], T)
187 Item[][] arr1 = [[Item()]]; 163 Item[][] arr1 = [[Item()]];
188 Item[][] arr2 = [[Item()]]; 164 Item[][] arr2 = [[Item()]];
189 165
190 _d_arrayappendTImpl!(typeof(arr1))._d_arrayappendT(arr1, arr2); 166 _d_arrayappendT(arr1, arr2);
191 167
192 // no postblit should have happened because arr{1,2} contain dynamic arrays 168 // no postblit should have happened because arr{1,2} contain dynamic arrays
193 assert(blitted == 0); 169 assert(blitted == 0);
@@ -207,7 +183,7 @@ template _d_arrayappendTImpl(Tarr : T[], T)
207 Item[1][] arr1 = [[Item()]]; 183 Item[1][] arr1 = [[Item()]];
208 Item[1][] arr2 = [[Item()]]; 184 Item[1][] arr2 = [[Item()]];
209 185
210 _d_arrayappendTImpl!(typeof(arr1))._d_arrayappendT(arr1, arr2); 186 _d_arrayappendT(arr1, arr2);
211 // copy constructor should have been invoked because arr{1,2} contain static arrays 187 // copy constructor should have been invoked because arr{1,2} contain static arrays
212 assert(copied >= arr2.length); 188 assert(copied >= arr2.length);
213} 189}
@@ -215,8 +191,8 @@ template _d_arrayappendTImpl(Tarr : T[], T)
215@safe nothrow unittest 191@safe nothrow unittest
216{ 192{
217 string str; 193 string str;
218 _d_arrayappendTImpl!(typeof(str))._d_arrayappendT(str, "a"); 194 _d_arrayappendT(str, "a");
219 _d_arrayappendTImpl!(typeof(str))._d_arrayappendT(str, "b"); 195 _d_arrayappendT(str, "b");
220 _d_arrayappendTImpl!(typeof(str))._d_arrayappendT(str, "c"); 196 _d_arrayappendT(str, "c");
221 assert(str == "abc"); 197 assert(str == "abc");
222} 198}
diff --git a/libphobos/libdruntime/core/internal/array/utils.d b/libphobos/libdruntime/core/internal/array/utils.d
index 7a829a0b3f7..41aa57faf0c 100644
--- a/libphobos/libdruntime/core/internal/array/utils.d
+++ b/libphobos/libdruntime/core/internal/array/utils.d
@@ -11,7 +11,7 @@ module core.internal.array.utils;
11 11
12import core.internal.traits : Parameters; 12import core.internal.traits : Parameters;
13 13
14private auto gcStatsPure() nothrow pure 14auto gcStatsPure() nothrow pure
15{ 15{
16 import core.memory : GC; 16 import core.memory : GC;
17 17
@@ -19,7 +19,7 @@ private auto gcStatsPure() nothrow pure
19 return impureBypass(); 19 return impureBypass();
20} 20}
21 21
22private ulong accumulatePure(string file, int line, string funcname, string name, ulong size) nothrow pure 22ulong accumulatePure(string file, int line, string funcname, string name, ulong size) nothrow pure
23{ 23{
24 static ulong impureBypass(string file, int line, string funcname, string name, ulong size) @nogc nothrow 24 static ulong impureBypass(string file, int line, string funcname, string name, ulong size) @nogc nothrow
25 { 25 {
@@ -35,41 +35,32 @@ private ulong accumulatePure(string file, int line, string funcname, string name
35} 35}
36 36
37/** 37/**
38 * TraceGC wrapper around runtime hook `Hook`. 38 * TraceGC wrapper generator around the runtime hook `Hook`.
39 * Params: 39 * Params:
40 * T = Type of hook to report to accumulate 40 * Type = The type of hook to report to accumulate
41 * Hook = The hook to wrap 41 * Hook = The name hook to wrap
42 * errorMessage = The error message incase `version != D_TypeInfo` 42 */
43 * file = File that called `_d_HookTraceImpl` 43template TraceHook(string Type, string Hook)
44 * line = Line inside of `file` that called `_d_HookTraceImpl`
45 * funcname = Function that called `_d_HookTraceImpl`
46 * parameters = Parameters that will be used to call `Hook`
47 * Bugs:
48 * This function template needs be between the compiler and a much older runtime hook that bypassed safety,
49 * purity, and throwabilty checks. To prevent breaking existing code, this function template
50 * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
51*/
52auto _d_HookTraceImpl(T, alias Hook, string errorMessage)(string file, int line, string funcname, Parameters!Hook parameters) @trusted pure
53{ 44{
54 version (D_TypeInfo) 45 const char[] TraceHook = q{
55 { 46 import core.internal.array.utils : gcStatsPure, accumulatePure;
47
56 pragma(inline, false); 48 pragma(inline, false);
57 string name = T.stringof; 49 string name = } ~ "`" ~ Type ~ "`;" ~ q{
58 50
59 // FIXME: use rt.tracegc.accumulator when it is accessable in the future. 51 // FIXME: use rt.tracegc.accumulator when it is accessable in the future.
60 version (tracegc) 52 version (tracegc)
61 { 53 } ~ "{\n" ~ q{
62 import core.stdc.stdio; 54 import core.stdc.stdio;
63 55
64 printf("%sTrace file = '%.*s' line = %d function = '%.*s' type = %.*s\n", 56 printf("%sTrace file = '%.*s' line = %d function = '%.*s' type = %.*s\n",
65 Hook.stringof.ptr, 57 } ~ "\"" ~ Hook ~ "\".ptr," ~ q{
66 file.length, file.ptr, 58 file.length, file.ptr,
67 line, 59 line,
68 funcname.length, funcname.ptr, 60 funcname.length, funcname.ptr,
69 name.length, name.ptr 61 name.length, name.ptr
70 ); 62 );
71 } 63 } ~ "}\n" ~ q{
72
73 ulong currentlyAllocated = gcStatsPure().allocatedInCurrentThread; 64 ulong currentlyAllocated = gcStatsPure().allocatedInCurrentThread;
74 65
75 scope(exit) 66 scope(exit)
@@ -86,6 +77,29 @@ auto _d_HookTraceImpl(T, alias Hook, string errorMessage)(string file, int line,
86 assert(0); 77 assert(0);
87 } 78 }
88 } 79 }
80 };
81}
82
83/**
84 * TraceGC wrapper around runtime hook `Hook`.
85 * Params:
86 * T = Type of hook to report to accumulate
87 * Hook = The hook to wrap
88 * errorMessage = The error message incase `version != D_TypeInfo`
89 * file = File that called `_d_HookTraceImpl`
90 * line = Line inside of `file` that called `_d_HookTraceImpl`
91 * funcname = Function that called `_d_HookTraceImpl`
92 * parameters = Parameters that will be used to call `Hook`
93 * Bugs:
94 * This function template needs be between the compiler and a much older runtime hook that bypassed safety,
95 * purity, and throwabilty checks. To prevent breaking existing code, this function template
96 * is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
97*/
98auto _d_HookTraceImpl(T, alias Hook, string errorMessage)(string file, int line, string funcname, Parameters!Hook parameters) @trusted pure
99{
100 version (D_TypeInfo)
101 {
102 mixin(TraceHook!(T.stringof, __traits(identifier, Hook)));
89 return Hook(parameters); 103 return Hook(parameters);
90 } 104 }
91 else 105 else
diff --git a/libphobos/libdruntime/core/internal/traits.d b/libphobos/libdruntime/core/internal/traits.d
index 0d733f2b384..0b4890cbfa9 100644
--- a/libphobos/libdruntime/core/internal/traits.d
+++ b/libphobos/libdruntime/core/internal/traits.d
@@ -234,7 +234,7 @@ if (Ts.length > 0)
234template classInstanceAlignment(T) 234template classInstanceAlignment(T)
235if (is(T == class)) 235if (is(T == class))
236{ 236{
237 alias classInstanceAlignment = maxAlignment!(void*, typeof(T.tupleof)); 237 enum classInstanceAlignment = __traits(classInstanceAlignment, T);
238} 238}
239 239
240/// See $(REF hasElaborateMove, std,traits) 240/// See $(REF hasElaborateMove, std,traits)
diff --git a/libphobos/libdruntime/core/lifetime.d b/libphobos/libdruntime/core/lifetime.d
index 47fed9dc514..6502e595e00 100644
--- a/libphobos/libdruntime/core/lifetime.d
+++ b/libphobos/libdruntime/core/lifetime.d
@@ -200,12 +200,10 @@ Returns: The newly constructed object.
200T emplace(T, Args...)(void[] chunk, auto ref Args args) 200T emplace(T, Args...)(void[] chunk, auto ref Args args)
201 if (is(T == class)) 201 if (is(T == class))
202{ 202{
203 import core.internal.traits : maxAlignment;
204
205 enum classSize = __traits(classInstanceSize, T); 203 enum classSize = __traits(classInstanceSize, T);
206 assert(chunk.length >= classSize, "chunk size too small."); 204 assert(chunk.length >= classSize, "chunk size too small.");
207 205
208 enum alignment = maxAlignment!(void*, typeof(T.tupleof)); 206 enum alignment = __traits(classInstanceAlignment, T);
209 assert((cast(size_t) chunk.ptr) % alignment == 0, "chunk is not aligned."); 207 assert((cast(size_t) chunk.ptr) % alignment == 0, "chunk is not aligned.");
210 208
211 return emplace!T(cast(T)(chunk.ptr), forward!args); 209 return emplace!T(cast(T)(chunk.ptr), forward!args);
@@ -242,9 +240,7 @@ T emplace(T, Args...)(void[] chunk, auto ref Args args)
242 int virtualGetI() { return i; } 240 int virtualGetI() { return i; }
243 } 241 }
244 242
245 import core.internal.traits : classInstanceAlignment; 243 align(__traits(classInstanceAlignment, C)) byte[__traits(classInstanceSize, C)] buffer;
246
247 align(classInstanceAlignment!C) byte[__traits(classInstanceSize, C)] buffer;
248 C c = emplace!C(buffer[], 42); 244 C c = emplace!C(buffer[], 42);
249 assert(c.virtualGetI() == 42); 245 assert(c.virtualGetI() == 42);
250} 246}
@@ -290,7 +286,8 @@ T emplace(T, Args...)(void[] chunk, auto ref Args args)
290 } 286 }
291 287
292 int var = 6; 288 int var = 6;
293 align(__conv_EmplaceTestClass.alignof) ubyte[__traits(classInstanceSize, __conv_EmplaceTestClass)] buf; 289 align(__traits(classInstanceAlignment, __conv_EmplaceTestClass))
290 ubyte[__traits(classInstanceSize, __conv_EmplaceTestClass)] buf;
294 auto support = (() @trusted => cast(__conv_EmplaceTestClass)(buf.ptr))(); 291 auto support = (() @trusted => cast(__conv_EmplaceTestClass)(buf.ptr))();
295 292
296 auto fromRval = emplace!__conv_EmplaceTestClass(support, 1); 293 auto fromRval = emplace!__conv_EmplaceTestClass(support, 1);
@@ -1198,7 +1195,7 @@ pure nothrow @safe /* @nogc */ unittest
1198 } 1195 }
1199 void[] buf; 1196 void[] buf;
1200 1197
1201 static align(A.alignof) byte[__traits(classInstanceSize, A)] sbuf; 1198 static align(__traits(classInstanceAlignment, A)) byte[__traits(classInstanceSize, A)] sbuf;
1202 buf = sbuf[]; 1199 buf = sbuf[];
1203 auto a = emplace!A(buf, 55); 1200 auto a = emplace!A(buf, 55);
1204 assert(a.x == 55 && a.y == 55); 1201 assert(a.x == 55 && a.y == 55);
diff --git a/libphobos/libdruntime/core/memory.d b/libphobos/libdruntime/core/memory.d
index 27c84e7f55e..b63b11100c1 100644
--- a/libphobos/libdruntime/core/memory.d
+++ b/libphobos/libdruntime/core/memory.d
@@ -31,7 +31,7 @@
31 $(LI Maintain another reference to that same data in another thread that the 31 $(LI Maintain another reference to that same data in another thread that the
32 GC does know about.) 32 GC does know about.)
33 $(LI Disable GC collection cycles while that thread is active with $(LREF disable)/$(LREF enable).) 33 $(LI Disable GC collection cycles while that thread is active with $(LREF disable)/$(LREF enable).)
34 $(LI Register the thread with the GC using $(REF thread_attachThis, core,thread)/$(REF thread_detachThis, core,thread).) 34 $(LI Register the thread with the GC using $(REF thread_attachThis, core,thread,osthread)/$(REF thread_detachThis, core,thread,threadbase).)
35 ) 35 )
36 ) 36 )
37 ) 37 )
diff --git a/libphobos/libdruntime/core/simd.d b/libphobos/libdruntime/core/simd.d
index 11a47118319..f1bf59b0ac4 100644
--- a/libphobos/libdruntime/core/simd.d
+++ b/libphobos/libdruntime/core/simd.d
@@ -409,6 +409,28 @@ version (D_SIMD)
409 * op2 = second operand 409 * op2 = second operand
410 * Returns: 410 * Returns:
411 * result of opcode 411 * result of opcode
412 * Example:
413 ---
414 import core.simd;
415 import core.stdc.stdio;
416
417 void main()
418 {
419 float4 A = [2.34f, -70000.0f, 0.00001f, 345.5f];
420 float4 R = A;
421 R = cast(float4) __simd(XMM.RCPSS, R, A);
422 printf("%g %g %g %g\n", R.array[0], R.array[1], R.array[2], R.array[3]);
423 }
424 ---
425 * Prints `0.427368 -70000 1e-05 345.5`.
426 * The use of the two operand form for `XMM.RCPSS` is necessary because the result of the instruction
427 * contains elements of both operands.
428 * Example:
429 ---
430 double[2] A = [56.0, -75.0];
431 double2 R = cast(double2) __simd(XMM.LODUPD, *cast(double2*)A.ptr);
432 ---
433 * The cast to `double2*` is necessary because the type of `*A.ptr` is `double`.
412 */ 434 */
413 pure @safe void16 __simd(XMM opcode, void16 op1, void16 op2); 435 pure @safe void16 __simd(XMM opcode, void16 op1, void16 op2);
414 436
@@ -480,6 +502,7 @@ version (D_SIMD)
480 /***** 502 /*****
481 * For "store" operations of the form: 503 * For "store" operations of the form:
482 * op1 op= op2 504 * op1 op= op2
505 * such as MOVLPS.
483 * Returns: 506 * Returns:
484 * op2 507 * op2
485 * These cannot be marked as pure, as semantic() doesn't check them. 508 * These cannot be marked as pure, as semantic() doesn't check them.
@@ -487,6 +510,7 @@ version (D_SIMD)
487 @safe void16 __simd_sto(XMM opcode, void16 op1, void16 op2); 510 @safe void16 __simd_sto(XMM opcode, void16 op1, void16 op2);
488 @safe void16 __simd_sto(XMM opcode, double op1, void16 op2); /// 511 @safe void16 __simd_sto(XMM opcode, double op1, void16 op2); ///
489 @safe void16 __simd_sto(XMM opcode, float op1, void16 op2); /// 512 @safe void16 __simd_sto(XMM opcode, float op1, void16 op2); ///
513 @safe void16 __simd_sto(XMM opcode, void16 op1, long op2); ///
490 514
491 /// 515 ///
492 unittest 516 unittest
diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d
index 035bba5eb30..2662fdb0fff 100644
--- a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d
+++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf32.d
@@ -13,108 +13,13 @@ extern (C):
13import core.stdc.stdint; 13import core.stdc.stdint;
14public import core.sys.dragonflybsd.sys.elf_common; 14public import core.sys.dragonflybsd.sys.elf_common;
15 15
16alias uint16_t Elf32_Half;
17alias uint32_t Elf32_Word;
18alias int32_t Elf32_Sword;
19alias uint64_t Elf32_Lword; 16alias uint64_t Elf32_Lword;
20alias uint32_t Elf32_Addr;
21alias uint32_t Elf32_Off;
22alias Elf32_Word Elf32_Hashelt; 17alias Elf32_Word Elf32_Hashelt;
23alias Elf32_Word Elf32_Size; 18alias Elf32_Word Elf32_Size;
24alias Elf32_Sword Elf32_Ssize; 19alias Elf32_Sword Elf32_Ssize;
25 20
26struct Elf32_Ehdr
27{
28 char[EI_NIDENT] e_ident = 0;
29 Elf32_Half e_type;
30 Elf32_Half e_machine;
31 Elf32_Word e_version;
32 Elf32_Addr e_entry;
33 Elf32_Off e_phoff;
34 Elf32_Off e_shoff;
35 Elf32_Word e_flags;
36 Elf32_Half e_ehsize;
37 Elf32_Half e_phentsize;
38 Elf32_Half e_phnum;
39 Elf32_Half e_shentsize;
40 Elf32_Half e_shnum;
41 Elf32_Half e_shstrndx;
42}
43
44struct Elf32_Shdr
45{
46 Elf32_Word sh_name;
47 Elf32_Word sh_type;
48 Elf32_Word sh_flags;
49 Elf32_Addr sh_addr;
50 Elf32_Off sh_offset;
51 Elf32_Word sh_size;
52 Elf32_Word sh_link;
53 Elf32_Word sh_info;
54 Elf32_Word sh_addralign;
55 Elf32_Word sh_entsize;
56}
57
58struct Elf32_Phdr
59{
60 Elf32_Word p_type;
61 Elf32_Off p_offset;
62 Elf32_Addr p_vaddr;
63 Elf32_Addr p_paddr;
64 Elf32_Word p_filesz;
65 Elf32_Word p_memsz;
66 Elf32_Word p_flags;
67 Elf32_Word p_align;
68}
69
70struct Elf32_Dyn
71{
72 Elf32_Sword d_tag;
73 union _d_un
74 {
75 Elf32_Word d_val;
76 Elf32_Addr d_ptr;
77 } _d_un d_un;
78}
79
80struct Elf32_Rel
81{
82 Elf32_Addr r_offset;
83 Elf32_Word r_info;
84}
85
86struct Elf32_Rela
87{
88 Elf32_Addr r_offset;
89 Elf32_Word r_info;
90 Elf32_Sword r_addend;
91}
92
93extern (D) pure @safe
94{
95 auto ELF32_R_SYM(V)(V val) { return val >> 8; }
96 auto ELF32_R_TYPE(V)(V val) { return val & 0xff; }
97 auto ELF32_R_INFO(S, T)(S sym, T type) { return (sym << 8) + (type & 0xff); }
98}
99
100alias Elf_Note Elf32_Nhdr; 21alias Elf_Note Elf32_Nhdr;
101 22
102struct Elf32_Move
103{
104 Elf32_Lword m_value;
105 Elf32_Word m_info;
106 Elf32_Word m_poffset;
107 Elf32_Half m_repeat;
108 Elf32_Half m_stride;
109}
110
111extern (D) pure
112{
113 auto ELF32_M_SYM(I)(I info) @safe { return info >> 8; }
114 auto ELF32_M_SIZE(I)(I info) { return cast(ubyte)info; }
115 auto ELF32_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubyte)size; }
116}
117
118struct Elf32_Cap 23struct Elf32_Cap
119{ 24{
120 Elf32_Word c_tag; 25 Elf32_Word c_tag;
@@ -125,63 +30,7 @@ struct Elf32_Cap
125 } _c_un c_un; 30 } _c_un c_un;
126} 31}
127 32
128struct Elf32_Sym 33extern (D)
129{
130 Elf32_Word st_name;
131 Elf32_Addr st_value;
132 Elf32_Word st_size;
133 ubyte st_info;
134 ubyte st_other;
135 Elf32_Half st_shndx;
136}
137
138extern (D) pure
139{
140 auto ELF32_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
141 auto ELF32_ST_TYPE(T)(T val) @safe { return val & 0xf; }
142 auto ELF32_ST_INFO(B, T)(B bind, T type) @safe { return (bind << 4) + (type & 0xf); }
143 auto ELF32_ST_VISIBILITY(O)(O o) @safe { return o & 0x03; }
144}
145
146struct Elf32_Verdef
147{
148 Elf32_Half vd_version;
149 Elf32_Half vd_flags;
150 Elf32_Half vd_ndx;
151 Elf32_Half vd_cnt;
152 Elf32_Word vd_hash;
153 Elf32_Word vd_aux;
154 Elf32_Word vd_next;
155}
156
157struct Elf32_Verdaux
158{
159 Elf32_Word vda_name;
160 Elf32_Word vda_next;
161}
162
163struct Elf32_Verneed
164{
165 Elf32_Half vn_version;
166 Elf32_Half vn_cnt;
167 Elf32_Word vn_file;
168 Elf32_Word vn_aux;
169 Elf32_Word vn_next;
170}
171
172struct Elf32_Vernaux
173{
174 Elf32_Word vna_hash;
175 Elf32_Half vna_flags;
176 Elf32_Half vna_other;
177 Elf32_Word vna_name;
178 Elf32_Word vna_next;
179}
180
181alias Elf32_Half Elf32_Versym;
182
183struct Elf32_Syminfo
184{ 34{
185 Elf32_Half si_boundto; 35 auto ELF32_ST_VISIBILITY(O)(O o) { return o & 0x03; }
186 Elf32_Half si_flags;
187} 36}
diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d
index f7d9247e0e3..6431bd2347a 100644
--- a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d
+++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf64.d
@@ -13,91 +13,13 @@ extern (C):
13import core.stdc.stdint; 13import core.stdc.stdint;
14public import core.sys.dragonflybsd.sys.elf_common; 14public import core.sys.dragonflybsd.sys.elf_common;
15 15
16alias uint16_t Elf64_Half;
17alias uint32_t Elf64_Word;
18alias int32_t Elf64_Sword;
19alias uint64_t Elf64_Lword; 16alias uint64_t Elf64_Lword;
20alias uint64_t Elf64_Xword;
21alias int64_t Elf64_Sxword;
22alias uint64_t Elf64_Addr;
23alias uint64_t Elf64_Off;
24alias Elf64_Word Elf64_Hashelt; 17alias Elf64_Word Elf64_Hashelt;
25alias Elf64_Xword Elf64_Size; 18alias Elf64_Xword Elf64_Size;
26alias Elf64_Sxword Elf64_Ssize; 19alias Elf64_Sxword Elf64_Ssize;
27 20
28struct Elf64_Ehdr
29{
30 char[EI_NIDENT] e_ident = 0;
31 Elf64_Half e_type;
32 Elf64_Half e_machine;
33 Elf64_Word e_version;
34 Elf64_Addr e_entry;
35 Elf64_Off e_phoff;
36 Elf64_Off e_shoff;
37 Elf64_Word e_flags;
38 Elf64_Half e_ehsize;
39 Elf64_Half e_phentsize;
40 Elf64_Half e_phnum;
41 Elf64_Half e_shentsize;
42 Elf64_Half e_shnum;
43 Elf64_Half e_shstrndx;
44}
45
46struct Elf64_Shdr
47{
48 Elf64_Word sh_name;
49 Elf64_Word sh_type;
50 Elf64_Xword sh_flags;
51 Elf64_Addr sh_addr;
52 Elf64_Off sh_offset;
53 Elf64_Xword sh_size;
54 Elf64_Word sh_link;
55 Elf64_Word sh_info;
56 Elf64_Xword sh_addralign;
57 Elf64_Xword sh_entsize;
58}
59
60struct Elf64_Phdr
61{
62 Elf64_Word p_type;
63 Elf64_Word p_flags;
64 Elf64_Off p_offset;
65 Elf64_Addr p_vaddr;
66 Elf64_Addr p_paddr;
67 Elf64_Xword p_filesz;
68 Elf64_Xword p_memsz;
69 Elf64_Xword p_align;
70}
71
72struct Elf64_Dyn
73{
74 Elf64_Sxword d_tag;
75 union _d_un
76 {
77 Elf64_Xword d_val;
78 Elf64_Addr d_ptr;
79 } _d_un d_un;
80}
81
82struct Elf64_Rel
83{
84 Elf64_Addr r_offset;
85 Elf64_Xword r_info;
86}
87
88struct Elf64_Rela
89{
90 Elf64_Addr r_offset;
91 Elf64_Xword r_info;
92 Elf64_Sxword r_addend;
93}
94
95extern (D) pure 21extern (D) pure
96{ 22{
97 auto ELF64_R_SYM(I)(I i) @safe { return i >> 32; }
98 auto ELF64_R_TYPE(I)(I i) @safe { return i & 0xffffffff; }
99 auto ELF64_R_INFO(S, T)(S sym, T type) @safe { return (sym << 32) + (type & 0xffffffff); }
100
101 auto ELF64_R_TYPE_DATA(I)(I i) { return (cast(Elf64_Xword) i << 32) >> 40; } 23 auto ELF64_R_TYPE_DATA(I)(I i) { return (cast(Elf64_Xword) i << 32) >> 40; }
102 auto ELF64_R_TYPE_ID(I)(I i) { return (cast(Elf64_Xword) i << 56 ) >> 56; } 24 auto ELF64_R_TYPE_ID(I)(I i) { return (cast(Elf64_Xword) i << 56 ) >> 56; }
103 auto ELF64_R_TYPE_INFO(D, T)(D d, T t) { return cast(Elf64_Xword) d << 8 + cast(Elf64_Xword) t; } 25 auto ELF64_R_TYPE_INFO(D, T)(D d, T t) { return cast(Elf64_Xword) d << 8 + cast(Elf64_Xword) t; }
@@ -105,22 +27,6 @@ extern (D) pure
105 27
106alias Elf_Note Elf64_Nhdr; 28alias Elf_Note Elf64_Nhdr;
107 29
108struct Elf64_Move
109{
110 Elf64_Lword m_value;
111 Elf64_Xword m_info;
112 Elf64_Xword m_poffset;
113 Elf64_Half m_repeat;
114 Elf64_Half m_stride;
115}
116
117extern (D) pure
118{
119 auto ELF64_M_SYM(I)(I info) @safe { return info >> 8; }
120 auto ELF64_M_SIZE(I)(I info) { return cast(ubyte)info; }
121 auto ELF64_M_INFO(S, SZ)(S sym, SZ size) @safe { return (sym << 8) + cast(ubyte)size; }
122}
123
124struct Elf64_Cap 30struct Elf64_Cap
125{ 31{
126 Elf64_Xword c_tag; 32 Elf64_Xword c_tag;
@@ -131,63 +37,7 @@ struct Elf64_Cap
131 } _c_un c_un; 37 } _c_un c_un;
132} 38}
133 39
134struct Elf64_Sym 40extern (D)
135{
136 Elf64_Word st_name;
137 ubyte st_info;
138 ubyte st_other;
139 Elf64_Half st_shndx;
140 Elf64_Addr st_value;
141 Elf64_Xword st_size;
142}
143
144extern (D) pure
145{
146 auto ELF64_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
147 auto ELF64_ST_TYPE(T)(T val) @safe { return val & 0xf; }
148 auto ELF64_ST_INFO(B, T)(B bind, T type) @safe { return (bind << 4) + (type & 0xf); }
149 auto ELF64_ST_VISIBILITY(O)(O o) @safe { return o & 0x03; }
150}
151
152struct Elf64_Verdef
153{
154 Elf64_Half vd_version;
155 Elf64_Half vd_flags;
156 Elf64_Half vd_ndx;
157 Elf64_Half vd_cnt;
158 Elf64_Word vd_hash;
159 Elf64_Word vd_aux;
160 Elf64_Word vd_next;
161}
162
163struct Elf64_Verdaux
164{
165 Elf64_Word vda_name;
166 Elf64_Word vda_next;
167}
168
169struct Elf64_Verneed
170{
171 Elf64_Half vn_version;
172 Elf64_Half vn_cnt;
173 Elf64_Word vn_file;
174 Elf64_Word vn_aux;
175 Elf64_Word vn_next;
176}
177
178struct Elf64_Vernaux
179{
180 Elf64_Word vna_hash;
181 Elf64_Half vna_flags;
182 Elf64_Half vna_other;
183 Elf64_Word vna_name;
184 Elf64_Word vna_next;
185}
186
187alias Elf64_Half Elf64_Versym;
188
189struct Elf64_Syminfo
190{ 41{
191 Elf64_Half si_boundto; 42 auto ELF64_ST_VISIBILITY(O)(O o) { return o & 0x03; }
192 Elf64_Half si_flags;
193} 43}
diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf_common.d b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf_common.d
index eef6a89e7a3..90e5861a6ac 100644
--- a/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf_common.d
+++ b/libphobos/libdruntime/core/sys/dragonflybsd/sys/elf_common.d
@@ -11,6 +11,7 @@ version (DragonFlyBSD):
11extern (C): 11extern (C):
12 12
13import core.stdc.stdint; 13import core.stdc.stdint;
14public import core.sys.elf;
14 15
15struct Elf_Note 16struct Elf_Note
16{ 17{
@@ -27,60 +28,7 @@ struct Elf_GNU_Hash_Header
27 uint32_t gh_shift2; 28 uint32_t gh_shift2;
28} 29}
29 30
30enum EI_MAG0 = 0;
31enum EI_MAG1 = 1;
32enum EI_MAG2 = 2;
33enum EI_MAG3 = 3;
34enum EI_CLASS = 4;
35enum EI_DATA = 5;
36enum EI_VERSION = 6;
37enum EI_OSABI = 7;
38enum EI_ABIVERSION = 8;
39enum OLD_EI_BRAND = 8; 31enum OLD_EI_BRAND = 8;
40enum EI_PAD = 9;
41enum EI_NIDENT = 16;
42
43enum ELFMAG0 = 0x7f;
44enum ELFMAG1 = 'E';
45enum ELFMAG2 = 'L';
46enum ELFMAG3 = 'F';
47enum ELFMAG = "\177ELF";
48enum SELFMAG = 4;
49
50enum EV_NONE = 0;
51enum EV_CURRENT = 1;
52
53enum ELFCLASSNONE = 0;
54enum ELFCLASS32 = 1;
55enum ELFCLASS64 = 2;
56
57enum ELFDATANONE = 0;
58enum ELFDATA2LSB = 1;
59enum ELFDATA2MSB = 2;
60
61enum ELFOSABI_NONE = 0;
62enum ELFOSABI_SYSV = 0;
63enum ELFOSABI_HPUX = 1;
64enum ELFOSABI_NETBSD = 2;
65enum ELFOSABI_LINUX = 3;
66enum ELFOSABI_HURD = 4;
67enum ELFOSABI_86OPEN = 5;
68enum ELFOSABI_SOLARIS = 6;
69enum ELFOSABI_AIX = 7;
70enum ELFOSABI_MONTEREY = 7;
71enum ELFOSABI_IRIX = 8;
72enum ELFOSABI_FREEBSD = 9;
73enum ELFOSABI_TRU64 = 10;
74enum ELFOSABI_MODESTO = 11;
75enum ELFOSABI_OPENBSD = 12;
76enum ELFOSABI_OPENVMS = 13;
77enum ELFOSABI_NSK = 14;
78enum ELFOSABI_AROS = 15;
79enum ELFOSABI_ARM = 97;
80enum ELFOSABI_STANDALONE = 255;
81
82// just a pointer
83enum ELFOSABI_DRAGONFLYBSD = ELFOSABI_NONE;
84 32
85extern (D) pure @safe 33extern (D) pure @safe
86{ 34{
@@ -90,587 +38,44 @@ extern (D) pure @safe
90 ehdr.e_ident[EI_MAG3] == ELFMAG3; } 38 ehdr.e_ident[EI_MAG3] == ELFMAG3; }
91} 39}
92 40
93enum ET_NONE = 0;
94enum ET_REL = 1;
95enum ET_EXEC = 2;
96enum ET_DYN = 3;
97enum ET_CORE = 4;
98enum ET_LOOS = 0xfe00;
99enum ET_HIOS = 0xfeff;
100enum ET_LOPROC = 0xff00;
101enum ET_HIPROC = 0xffff;
102
103enum EM_NONE = 0;
104enum EM_M32 = 1;
105enum EM_SPARC = 2;
106enum EM_386 = 3;
107enum EM_68K = 4;
108enum EM_88K = 5;
109enum EM_860 = 7;
110enum EM_MIPS = 8;
111enum EM_S370 = 9;
112enum EM_MIPS_RS3_LE = 10;
113enum EM_PARISC = 15;
114enum EM_VPP500 = 17;
115enum EM_SPARC32PLUS = 18;
116enum EM_960 = 19;
117enum EM_PPC = 20;
118enum EM_PPC64 = 21;
119enum EM_S390 = 22;
120enum EM_V800 = 36;
121enum EM_FR20 = 37;
122enum EM_RH32 = 38;
123enum EM_RCE = 39;
124enum EM_ARM = 40;
125enum EM_SH = 42;
126enum EM_SPARCV9 = 43;
127enum EM_TRICORE = 44;
128enum EM_ARC = 45;
129enum EM_H8_300 = 46;
130enum EM_H8_300H = 47;
131enum EM_H8S = 48;
132enum EM_H8_500 = 49;
133enum EM_IA_64 = 50;
134enum EM_MIPS_X = 51;
135enum EM_COLDFIRE = 52;
136enum EM_68HC12 = 53;
137enum EM_MMA = 54;
138enum EM_PCP = 55;
139enum EM_NCPU = 56;
140enum EM_NDR1 = 57;
141enum EM_STARCORE = 58;
142enum EM_ME16 = 59;
143enum EM_ST100 = 60;
144enum EM_TINYJ = 61;
145enum EM_X86_64 = 62;
146enum EM_AMD64 = 62;
147enum EM_PDSP = 63;
148enum EM_FX66 = 66;
149enum EM_ST9PLUS = 67;
150enum EM_ST7 = 68;
151enum EM_68HC16 = 69;
152enum EM_68HC11 = 70;
153enum EM_68HC08 = 71;
154enum EM_68HC05 = 72;
155enum EM_SVX = 73;
156enum EM_ST19 = 74;
157enum EM_VAX = 75;
158enum EM_CRIS = 76;
159enum EM_JAVELIN = 77;
160enum EM_FIREPATH = 78;
161enum EM_ZSP = 79;
162enum EM_MMIX = 80;
163enum EM_HUANY = 81;
164enum EM_PRISM = 82;
165enum EM_AVR = 83;
166enum EM_FR30 = 84;
167enum EM_D10V = 85;
168enum EM_D30V = 86;
169enum EM_V850 = 87;
170enum EM_M32R = 88;
171enum EM_MN10300 = 89;
172enum EM_MN10200 = 90;
173enum EM_PJ = 91;
174enum EM_OPENRISC = 92;
175enum EM_ARC_A5 = 93;
176enum EM_XTENSA = 94;
177enum EM_VIDEOCORE = 95;
178enum EM_TMM_GPP = 96;
179enum EM_NS32K = 97;
180enum EM_TPC = 98;
181enum EM_SNP1K = 99;
182enum EM_ST200 = 100;
183enum EM_IP2K = 101;
184enum EM_MAX = 102;
185enum EM_CR = 103;
186enum EM_F2MC16 = 104;
187enum EM_MSP430 = 105;
188enum EM_BLACKFIN = 106;
189enum EM_SE_C33 = 107;
190enum EM_SEP = 108;
191enum EM_ARCA = 109;
192enum EM_UNICORE = 110;
193enum EM_DXP = 112;
194enum EM_ALTERA_NIOS2 =113;
195enum EM_CRX = 114;
196enum EM_XGATE = 115;
197enum EM_C166 = 116;
198enum EM_M16C = 117;
199enum EM_DSPIC30F = 118;
200enum EM_CE = 119;
201enum EM_M32C = 120;
202enum EM_res121 = 121;
203enum EM_res122 = 122;
204enum EM_res123 = 123;
205enum EM_res124 = 124;
206enum EM_res125 = 125;
207enum EM_res126 = 126;
208enum EM_res127 = 127;
209enum EM_res128 = 128;
210enum EM_res129 = 129;
211enum EM_res130 = 130;
212enum EM_TSK3000 = 131;
213enum EM_RS08 = 132;
214enum EM_res133 = 133;
215enum EM_ECOG2 = 134;
216enum EM_SCORE = 135;
217enum EM_SCORE7 = 135;
218enum EM_DSP24 = 136;
219enum EM_VIDEOCORE3 = 137;
220enum EM_LATTICEMICO32 = 138;
221enum EM_SE_C17 = 139;
222enum EM_TI_C6000 = 140;
223enum EM_TI_C2000 = 141;
224enum EM_TI_C5500 = 142;
225enum EM_res143 = 143;
226enum EM_res144 = 144;
227enum EM_res145 = 145;
228enum EM_res146 = 146;
229enum EM_res147 = 147;
230enum EM_res148 = 148;
231enum EM_res149 = 149;
232enum EM_res150 = 150;
233enum EM_res151 = 151;
234enum EM_res152 = 152;
235enum EM_res153 = 153;
236enum EM_res154 = 154;
237enum EM_res155 = 155;
238enum EM_res156 = 156;
239enum EM_res157 = 157;
240enum EM_res158 = 158;
241enum EM_res159 = 159;
242enum EM_MMDSP_PLUS = 160;
243enum EM_CYPRESS_M8C = 161;
244enum EM_R32C = 162;
245enum EM_TRIMEDIA = 163;
246enum EM_QDSP6 = 164;
247enum EM_8051 = 165;
248enum EM_STXP7X = 166;
249enum EM_NDS32 = 167;
250enum EM_ECOG1 = 168;
251enum EM_ECOG1X = 168;
252enum EM_MAXQ30 = 169;
253enum EM_XIMO16 = 170;
254enum EM_MANIK = 171;
255enum EM_CRAYNV2 = 172;
256enum EM_RX = 173;
257enum EM_METAG = 174;
258enum EM_MCST_ELBRUS = 175;
259enum EM_ECOG16 = 176;
260enum EM_CR16 = 177;
261enum EM_ETPU = 178;
262enum EM_SLE9X = 179;
263enum EM_L1OM = 180;
264enum EM_K1OM = 181;
265enum EM_INTEL182 = 182;
266enum EM_res183 = 183;
267enum EM_res184 = 184;
268enum EM_AVR32 = 185;
269enum EM_STM8 = 186;
270enum EM_TILE64 = 187;
271enum EM_TILEPRO = 188;
272enum EM_MICROBLAZE = 189;
273enum EM_CUDA = 190;
274enum EM_TILEGX = 191;
275
276enum EM_486 = 6; 41enum EM_486 = 6;
277enum EM_MIPS_RS4_BE = 10; 42enum EM_MIPS_RS4_BE = 10;
278enum EM_ALPHA_STD = 41; 43enum EM_ALPHA_STD = 41;
279enum EM_ALPHA = 0x9026;
280
281enum SHN_UNDEF = 0;
282enum SHN_LORESERVE = 0xff00;
283enum SHN_LOPROC = 0xff00;
284enum SHN_HIPROC = 0xff1f;
285enum SHN_LOOS = 0xff20;
286enum SHN_HIOS = 0xff3f;
287enum SHN_ABS = 0xfff1;
288enum SHN_COMMON = 0xfff2;
289enum SHN_XINDEX = 0xffff;
290enum SHN_HIRESERVE = 0xffff;
291
292enum PT_NULL = 0;
293enum PT_LOAD = 1;
294enum PT_DYNAMIC = 2;
295enum PT_INTERP = 3;
296enum PT_NOTE = 4;
297enum PT_SHLIB = 5;
298enum PT_PHDR = 6;
299enum PT_TLS = 7;
300enum PT_LOOS = 0x60000000;
301enum PT_HIOS = 0x6fffffff;
302enum PT_LOPROC = 0x70000000;
303enum PT_HIPROC = 0x7fffffff;
304 44
305enum PT_GNU_EH_FRAME = PT_LOOS + 0x474e550; /* Frame unwind information */ 45enum PT_SUNW_EH_FRAME = PT_GNU_EH_FRAME;
306enum PT_SUNW_EH_FRAME = PT_GNU_EH_FRAME; /* Solaris uses the same value */
307enum PT_GNU_STACK = PT_LOOS + 0x474e551; /* Stack flags */
308enum PT_GNU_RELRO = PT_LOOS + 0x474e552; /* Read-only after relocation */
309
310enum PF_X = 0x1;
311enum PF_W = 0x2;
312enum PF_R = 0x4;
313enum PF_MASKOS = 0x0ff00000;
314enum PF_MASKPROC = 0xf0000000;
315
316enum PN_XNUM = 0xffff;
317
318enum SHT_NULL = 0;
319enum SHT_PROGBITS = 1;
320enum SHT_SYMTAB = 2;
321enum SHT_STRTAB = 3;
322enum SHT_RELA = 4;
323enum SHT_HASH = 5;
324enum SHT_DYNAMIC = 6;
325enum SHT_NOTE = 7;
326enum SHT_NOBITS = 8;
327enum SHT_REL = 9;
328enum SHT_SHLIB = 10;
329enum SHT_DYNSYM = 11;
330
331enum SHT_INIT_ARRAY = 14;
332enum SHT_FINI_ARRAY = 15;
333enum SHT_PREINIT_ARRAY = 16;
334enum SHT_GROUP = 17;
335enum SHT_SYMTAB_SHNDX = 18;
336
337enum SHT_LOOS = 0x60000000;
338enum SHT_LOSUNW = 0x6ffffff4;
339 46
340enum SHT_GNU_INCREMENTAL_INPUTS = 0x6fff4700; 47enum SHT_GNU_INCREMENTAL_INPUTS = 0x6fff4700;
341enum SHT_GNU_ATTRIBUTES = 0x6ffffff5;
342enum SHT_GNU_HASH = 0x6ffffff6;
343enum SHT_GNU_LIBLIST = 0x6ffffff7;
344 48
345//enum SHT_SUNW_dof = 0x6ffffff4;
346//enum SHT_SUNW_cap = 0x6ffffff5;
347//enum SHT_SUNW_SIGNATURE = 0x6ffffff6;
348enum SHT_SUNW_verdef = 0x6ffffffd; 49enum SHT_SUNW_verdef = 0x6ffffffd;
349enum SHT_SUNW_verneed = 0x6ffffffe; 50enum SHT_SUNW_verneed = 0x6ffffffe;
350enum SHT_SUNW_versym = 0x6fffffff; 51enum SHT_SUNW_versym = 0x6fffffff;
351 52
352enum SHT_GNU_verdef = SHT_SUNW_verdef;
353enum SHT_GNU_verneed = SHT_SUNW_verneed;
354enum SHT_GNU_versym = SHT_SUNW_versym;
355
356enum SHT_LOPROC = 0x70000000;
357enum SHT_HIPROC = 0x7fffffff;
358enum SHT_LOUSER = 0x80000000;
359enum SHT_HIUSER = 0x8fffffff;
360
361/*
362enum SHT_GNU_HASH = 0x6ffffff6;
363enum SHT_SUNW_ANNOTATE = 0x6ffffff7;
364enum SHT_SUNW_DEBUGSTR = 0x6ffffff8;
365enum SHT_SUNW_DEBUG = 0x6ffffff9;
366enum SHT_SUNW_move = 0x6ffffffa;
367enum SHT_SUNW_COMDAT = 0x6ffffffb;
368enum SHT_SUNW_syminfo = 0x6ffffffc;
369enum SHT_HISUNW = 0x6fffffff;
370enum SHT_HIOS = 0x6fffffff;
371enum SHT_AMD64_UNWIND = 0x70000001;
372enum SHT_ARM_EXIDX = 0x70000001;
373enum SHT_ARM_PREEMPTMAP = 0x70000002;
374enum SHT_ARM_ATTRIBUTES = 0x70000003;
375enum SHT_ARM_DEBUGOVERLAY = 0x70000004;
376enum SHT_ARM_OVERLAYSECTION = 0x70000005;
377enum SHT_MIPS_REGINFO = 0x70000006;
378enum SHT_MIPS_OPTIONS = 0x7000000d;
379enum SHT_MIPS_DWARF = 0x7000001e;
380*/
381
382enum SHF_WRITE = (1 << 0);
383enum SHF_ALLOC = (1 << 1);
384enum SHF_EXECINSTR = (1 << 2);
385enum SHF_MERGE = (1 << 4);
386enum SHF_STRINGS = (1 << 5);
387enum SHF_INFO_LINK = (1 << 6);
388enum SHF_LINK_ORDER = (1 << 7);
389enum SHF_OS_NONCONFORMING = (1 << 8);
390enum SHF_GROUP = (1 << 9);
391enum SHF_TLS = (1 << 10);
392enum SHF_COMPRESSED = (1 << 11);
393
394enum SHF_MASKOS = 0x0ff00000;
395enum SHF_MASKPROC = 0xf0000000;
396
397enum NT_PRSTATUS = 1; 53enum NT_PRSTATUS = 1;
398enum NT_FPREGSET = 2; 54enum NT_FPREGSET = 2;
399enum NT_PRPSINFO = 3; 55enum NT_PRPSINFO = 3;
400enum NT_TASKSTRUCT = 4; 56enum NT_TASKSTRUCT = 4;
401enum NT_AUXV = 6; 57enum NT_AUXV = 6;
402 58
403/*
404enum NT_THRMISC = 7;
405enum NT_PROCSTAT_PROC = 8;
406enum NT_PROCSTAT_FILES = 9;
407enum NT_PROCSTAT_VMMAP = 10;
408enum NT_PROCSTAT_GROUPS = 11;
409enum NT_PROCSTAT_UMASK = 12;
410enum NT_PROCSTAT_RLIMIT = 13;
411enum NT_PROCSTAT_OSREL = 14;
412enum NT_PROCSTAT_PSSTRINGS = 15;
413enum NT_PROCSTAT_AUXV = 16;
414*/
415
416enum STN_UNDEF = 0;
417
418enum STB_LOCAL = 0;
419enum STB_GLOBAL = 1;
420enum STB_WEAK = 2;
421enum STB_NUM = 3;
422enum STB_LOOS = 10;
423enum STB_HIOS = 12;
424enum STB_LOPROC = 13;
425enum STB_HIPROC = 15;
426
427enum STT_NOTYPE = 0;
428enum STT_OBJECT = 1;
429enum STT_FUNC = 2;
430enum STT_SECTION = 3;
431enum STT_FILE = 4;
432enum STT_COMMON = 5;
433enum STT_TLS = 6;
434enum STT_NUM = 7;
435enum STT_LOOS = 10;
436enum STT_GNU_IFUNC = 10;
437enum STT_HIOS = 12;
438enum STT_LOPROC = 13;
439enum STT_HIPROC = 15;
440
441enum STV_DEFAULT = 0;
442enum STV_INTERNAL = 1;
443enum STV_HIDDEN = 2;
444enum STV_PROTECTED = 3;
445/*
446enum STV_EXPORTED = 4;
447enum STV_SINGLETON = 5;
448enum STV_ELIMINATE = 6;
449*/
450
451enum DT_NULL = 0;
452enum DT_NEEDED = 1;
453enum DT_PLTRELSZ = 2;
454enum DT_PLTGOT = 3;
455enum DT_HASH = 4;
456enum DT_STRTAB = 5;
457enum DT_SYMTAB = 6;
458enum DT_RELA = 7;
459enum DT_RELASZ = 8;
460enum DT_RELAENT = 9;
461enum DT_STRSZ = 10;
462enum DT_SYMENT = 11;
463enum DT_INIT = 12;
464enum DT_FINI = 13;
465enum DT_SONAME = 14;
466enum DT_RPATH = 15;
467enum DT_SYMBOLIC = 16;
468enum DT_REL = 17;
469enum DT_RELSZ = 18;
470enum DT_RELENT = 19;
471enum DT_PLTREL = 20;
472enum DT_DEBUG = 21;
473enum DT_TEXTREL = 22;
474enum DT_JMPREL = 23;
475enum DT_BIND_NOW = 24;
476enum DT_INIT_ARRAY = 25;
477enum DT_FINI_ARRAY = 26;
478enum DT_INIT_ARRAYSZ = 27;
479enum DT_FINI_ARRAYSZ = 28;
480enum DT_RUNPATH = 29;
481enum DT_FLAGS = 30;
482
483enum DT_ENCODING = 32;
484enum DT_PREINIT_ARRAY = 32;
485enum DT_PREINIT_ARRAYSZ = 33;
486//enum DT_MAXPOSTAGS = 34;
487enum DT_LOOS = 0x6000000d;
488enum DT_HIOS = 0x6ffff000;
489/*
490enum DT_SUNW_AUXILIARY = 0x6000000d;
491enum DT_SUNW_RTLDINF = 0x6000000e;
492enum DT_SUNW_FILTER = 0x6000000f;
493enum DT_SUNW_CAP = 0x60000010;
494*/
495
496enum DT_VALRNGLO = 0x6ffffd00;
497enum DT_GNU_PRELINKED = 0x6ffffdf5;
498enum DT_GNU_CONFLICTSZ =0x6ffffdf6;
499enum DT_GNU_LIBLISTSZ = 0x6ffffdf7;
500enum DT_CHECKSUM = 0x6ffffdf8;
501enum DT_PLTPADSZ = 0x6ffffdf9;
502enum DT_MOVEENT = 0x6ffffdfa;
503enum DT_MOVESZ = 0x6ffffdfb;
504enum DT_FEATURE_1 = 0x6ffffdfc;
505enum DT_POSFLAG_1 = 0x6ffffdfd;
506enum DT_SYMINSZ = 0x6ffffdfe;
507enum DT_SYMINENT = 0x6ffffdff;
508enum DT_VALRNGHI = 0x6ffffdff;
509enum DT_ADDRRNGLO = 0x6ffffe00;
510enum DT_GNU_HASH = 0x6ffffef5;
511enum DT_TLSDESC_PLT = 0x6ffffef6;
512enum DT_TLSDESC_GOT = 0x6ffffef7;
513enum DT_GNU_CONFLICT = 0x6ffffef8;
514enum DT_GNU_LIBLIST = 0x6ffffef9;
515enum DT_CONFIG = 0x6ffffefa;
516enum DT_DEPAUDIT = 0x6ffffefb;
517enum DT_AUDIT = 0x6ffffefc;
518enum DT_PLTPAD = 0x6ffffefd;
519enum DT_MOVETAB = 0x6ffffefe;
520enum DT_SYMINFO = 0x6ffffeff;
521enum DT_ADDRRNGHI = 0x6ffffeff;
522enum DT_RELACOUNT = 0x6ffffff9;
523enum DT_RELCOUNT = 0x6ffffffa;
524enum DT_FLAGS_1 = 0x6ffffffb;
525enum DT_VERDEF = 0x6ffffffc;
526enum DT_VERDEFNUM = 0x6ffffffd;
527enum DT_VERNEED = 0x6ffffffe;
528enum DT_VERNEEDNUM = 0x6fffffff;
529enum DT_VERSYM = 0x6ffffff0;
530enum DT_LOPROC = 0x70000000;
531//enum DT_DEPRECATED_SPARC_REGISTER = 0x7000001;
532enum DT_AUXILIARY = 0x7ffffffd;
533enum DT_USED = 0x7ffffffe; 59enum DT_USED = 0x7ffffffe;
534enum DT_FILTER = 0x7fffffff;
535enum DT_HIPROC = 0x7fffffff;
536
537enum DTF_1_PARINIT = 0x00000001;
538enum DTF_1_CONFEXP = 0x00000002;
539
540enum DF_P1_LAZYLOAD = 0x00000001;
541enum DF_P1_GROUPPERM= 0x00000002;
542 60
543enum DF_1_NOW = 0x00000001;
544enum DF_1_BIND_NOW = 0x00000001; 61enum DF_1_BIND_NOW = 0x00000001;
545enum DF_1_GLOBAL = 0x00000002;
546enum DF_1_GROUP = 0x00000004;
547enum DF_1_NODELETE = 0x00000008;
548enum DF_1_LOADFLTR = 0x00000010;
549enum DF_1_INITFIRST = 0x00000020;
550enum DF_1_NOOPEN = 0x00000040;
551enum DF_1_ORIGIN = 0x00000080;
552enum DF_1_DIRECT = 0x00000100;
553enum DF_1_TRANS = 0x00000200;
554enum DF_1_INTERPOSE = 0x00000400;
555enum DF_1_NODEFLIB = 0x00000800;
556enum DF_1_NODUMP = 0x00001000;
557enum DF_1_CONLFAT = 0x00002000;
558 62
559enum DF_ORIGIN = 0x00000001;
560enum DF_SYMBOLIC = 0x00000002;
561enum DF_TEXTREL = 0x00000004;
562enum DF_BIND_NOW = 0x00000008;
563enum DF_STATIC_TLS = 0x00000010;
564
565enum VER_DEF_NONE = 0;
566enum VER_DEF_CURRENT = 1;
567alias VER_NDX VER_DEF_IDX; 63alias VER_NDX VER_DEF_IDX;
568 64
569enum VER_FLG_BASE = 0x1;
570enum VER_FLG_WEAK = 0x2;
571enum VER_FLG_INFO = 0x4; 65enum VER_FLG_INFO = 0x4;
572 66
573enum VER_NDX_LOCAL = 0;
574enum VER_NDX_GLOBAL = 1;
575enum VER_NDX_GIVEN = 2; 67enum VER_NDX_GIVEN = 2;
576enum VER_NDX_HIDDEN = 32768; 68enum VER_NDX_HIDDEN = 32768;
69
577extern (D) pure @safe 70extern (D) pure @safe
578{ 71{
579 auto VER_NDX(V)(V v) { return v & ~(1u << 15); } 72 auto VER_NDX(V)(V v) { return v & ~(1u << 15); }
580} 73}
581 74
582enum VER_NEED_NONE = 0;
583enum VER_NEED_CURRENT = 1;
584enum VER_NEED_WEAK = 32768; 75enum VER_NEED_WEAK = 32768;
585enum VER_NEED_HIDDEN = VER_NDX_HIDDEN; 76enum VER_NEED_HIDDEN = VER_NDX_HIDDEN;
586alias VER_NDX VER_NEED_IDX; 77alias VER_NDX VER_NEED_IDX;
587 78
588/*
589enum CA_SUNW_NULL = 0;
590enum CA_SUNW_HW_1 = 1;
591enum CA_SUNW_SF_1 = 2;
592*/
593
594enum VERSYM_HIDDEN = 0x8000; 79enum VERSYM_HIDDEN = 0x8000;
595enum VERSYM_VERSION = 0x7fff; 80enum VERSYM_VERSION = 0x7fff;
596enum ELF_VER_CHR = '@'; 81enum ELF_VER_CHR = '@';
597
598enum SYMINFO_BT_SELF = 0xffff;
599enum SYMINFO_BT_PARENT = 0xfffe;
600//enum SYMINFO_BT_NONE = 0xfffd;
601//enum SYMINFO_BT_EXTERN = 0xfffc;
602enum SYMINFO_BT_LOWRESERVE = 0xff00;
603
604enum SYMINFO_FLG_DIRECT = 0x0001;
605enum SYMINFO_FLG_PASSTHRU = 0x0002;
606enum SYMINFO_FLG_COPY = 0x0004;
607enum SYMINFO_FLG_LAZYLOAD = 0x0008;
608//enum SYMINFO_FLG_DIRECTBIND = 0x0010;
609//enum SYMINFO_FLG_NOEXTDIRECT = 0x0020;
610//enum SYMINFO_FLG_FILTER = 0x0002;
611//enum SYMINFO_FLG_AUXILIARY = 0x0040;
612
613enum SYMINFO_NONE = 0;
614enum SYMINFO_CURRENT = 1;
615enum SYMINFO_NUM = 2;
616
617enum GRP_COMDAT = 0x1;
618
619enum R_386_NONE = 0;
620enum R_386_32 = 1;
621enum R_386_PC32 = 2;
622enum R_386_GOT32 = 3;
623enum R_386_PLT32 = 4;
624enum R_386_COPY = 5;
625enum R_386_GLOB_DAT = 6;
626enum R_386_JMP_SLOT = 7;
627enum R_386_RELATIVE = 8;
628enum R_386_GOTOFF = 9;
629enum R_386_GOTPC = 10;
630enum R_386_TLS_TPOFF = 14;
631enum R_386_TLS_IE = 15;
632enum R_386_TLS_GOTIE = 16;
633enum R_386_TLS_LE = 17;
634enum R_386_TLS_GD = 18;
635enum R_386_TLS_LDM = 19;
636enum R_386_TLS_GD_32 = 24;
637enum R_386_TLS_GD_PUSH = 25;
638enum R_386_TLS_GD_CALL = 26;
639enum R_386_TLS_GD_POP = 27;
640enum R_386_TLS_LDM_32 = 28;
641enum R_386_TLS_LDM_PUSH = 29;
642enum R_386_TLS_LDM_CALL = 30;
643enum R_386_TLS_LDM_POP = 31;
644enum R_386_TLS_LDO_32 = 32;
645enum R_386_TLS_IE_32 = 33;
646enum R_386_TLS_LE_32 = 34;
647enum R_386_TLS_DTPMOD32 = 35;
648enum R_386_TLS_DTPOFF32 = 36;
649enum R_386_TLS_TPOFF32 = 37;
650enum R_386_IRELATIVE = 42;
651
652enum R_X86_64_NONE = 0;
653enum R_X86_64_64 = 1;
654enum R_X86_64_PC32 = 2;
655enum R_X86_64_GOT32 = 3;
656enum R_X86_64_PLT32 = 4;
657enum R_X86_64_COPY = 5;
658enum R_X86_64_GLOB_DAT = 6;
659enum R_X86_64_JMP_SLOT = 7;
660enum R_X86_64_RELATIVE = 8;
661enum R_X86_64_GOTPCREL = 9;
662enum R_X86_64_32 = 10;
663enum R_X86_64_32S = 11;
664enum R_X86_64_16 = 12;
665enum R_X86_64_PC16 = 13;
666enum R_X86_64_8 = 14;
667enum R_X86_64_PC8 = 15;
668enum R_X86_64_DTPMOD64 = 16;
669enum R_X86_64_DTPOFF64 = 17;
670enum R_X86_64_TPOFF64 = 18;
671enum R_X86_64_TLSGD = 19;
672enum R_X86_64_TLSLD = 20;
673enum R_X86_64_DTPOFF32 = 21;
674enum R_X86_64_GOTTPOFF = 22;
675enum R_X86_64_TPOFF32 = 23;
676enum R_X86_64_IRELATIVE = 37;
diff --git a/libphobos/libdruntime/core/sys/elf/package.d b/libphobos/libdruntime/core/sys/elf/package.d
new file mode 100644
index 00000000000..5de897ab420
--- /dev/null
+++ b/libphobos/libdruntime/core/sys/elf/package.d
@@ -0,0 +1,2532 @@
1/**
2 * D header file for standard ELF types, structures, and macros.
3 *
4 * $(LINK2 http://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h, glibc elf/elf.h)
5 */
6module core.sys.elf;
7
8extern (C):
9pure:
10nothrow:
11@system:
12
13import core.stdc.stdint;
14
15alias uint16_t Elf32_Half;
16alias uint16_t Elf64_Half;
17
18alias uint32_t Elf32_Word;
19alias int32_t Elf32_Sword;
20alias uint32_t Elf64_Word;
21alias int32_t Elf64_Sword;
22
23alias uint64_t Elf32_Xword;
24alias int64_t Elf32_Sxword;
25alias uint64_t Elf64_Xword;
26alias int64_t Elf64_Sxword;
27
28alias uint32_t Elf32_Addr;
29alias uint64_t Elf64_Addr;
30
31alias uint32_t Elf32_Off;
32alias uint64_t Elf64_Off;
33
34alias uint16_t Elf32_Section;
35alias uint16_t Elf64_Section;
36
37alias Elf32_Half Elf32_Versym;
38alias Elf64_Half Elf64_Versym;
39
40enum EI_NIDENT = 16;
41
42struct Elf32_Ehdr
43{
44 char[EI_NIDENT] e_ident = 0;
45 Elf32_Half e_type;
46 Elf32_Half e_machine;
47 Elf32_Word e_version;
48 Elf32_Addr e_entry;
49 Elf32_Off e_phoff;
50 Elf32_Off e_shoff;
51 Elf32_Word e_flags;
52 Elf32_Half e_ehsize;
53 Elf32_Half e_phentsize;
54 Elf32_Half e_phnum;
55 Elf32_Half e_shentsize;
56 Elf32_Half e_shnum;
57 Elf32_Half e_shstrndx;
58}
59
60struct Elf64_Ehdr
61{
62 char[EI_NIDENT] e_ident = 0;
63 Elf64_Half e_type;
64 Elf64_Half e_machine;
65 Elf64_Word e_version;
66 Elf64_Addr e_entry;
67 Elf64_Off e_phoff;
68 Elf64_Off e_shoff;
69 Elf64_Word e_flags;
70 Elf64_Half e_ehsize;
71 Elf64_Half e_phentsize;
72 Elf64_Half e_phnum;
73 Elf64_Half e_shentsize;
74 Elf64_Half e_shnum;
75 Elf64_Half e_shstrndx;
76}
77
78enum EI_MAG0 = 0;
79enum ELFMAG0 = 0x7f;
80
81enum EI_MAG1 = 1;
82enum ELFMAG1 = 'E';
83
84enum EI_MAG2 = 2;
85enum ELFMAG2 = 'L';
86
87enum EI_MAG3 = 3;
88enum ELFMAG3 = 'F';
89enum ELFMAG = "\177ELF";
90enum SELFMAG = 4;
91
92enum EI_CLASS = 4;
93enum ELFCLASSNONE = 0;
94enum ELFCLASS32 = 1;
95enum ELFCLASS64 = 2;
96enum ELFCLASSNUM = 3;
97
98enum EI_DATA = 5;
99enum ELFDATANONE = 0;
100enum ELFDATA2LSB = 1;
101enum ELFDATA2MSB = 2;
102enum ELFDATANUM = 3;
103
104enum EI_VERSION = 6;
105
106enum EI_OSABI = 7;
107enum ELFOSABI_NONE = 0;
108enum ELFOSABI_SYSV = 0;
109enum ELFOSABI_HPUX = 1;
110enum ELFOSABI_NETBSD = 2;
111enum ELFOSABI_GNU = 3;
112enum ELFOSABI_LINUX = ELFOSABI_GNU;
113enum ELFOSABI_HURD = 4;
114enum ELFOSABI_86OPEN = 5;
115enum ELFOSABI_SOLARIS = 6;
116enum ELFOSABI_AIX = 7;
117enum ELFOSABI_MONTEREY = 7;
118enum ELFOSABI_IRIX = 8;
119enum ELFOSABI_FREEBSD = 9;
120enum ELFOSABI_TRU64 = 10;
121enum ELFOSABI_MODESTO = 11;
122enum ELFOSABI_OPENBSD = 12;
123enum ELFOSABI_OPENVMS = 13;
124enum ELFOSABI_NSK = 14;
125enum ELFOSABI_AROS = 15;
126enum ELFOSABI_ARM_AEABI = 64;
127enum ELFOSABI_ARM = 97;
128enum ELFOSABI_STANDALONE = 255;
129enum ELFOSABI_DRAGONFLYBSD = ELFOSABI_NONE;
130
131enum EI_ABIVERSION = 8;
132
133enum EI_PAD = 9;
134
135enum ET_NONE = 0;
136enum ET_REL = 1;
137enum ET_EXEC = 2;
138enum ET_DYN = 3;
139enum ET_CORE = 4;
140enum ET_NUM = 5;
141enum ET_LOOS = 0xfe00;
142enum ET_HIOS = 0xfeff;
143enum ET_LOPROC = 0xff00;
144enum ET_HIPROC = 0xffff;
145
146enum EM_NONE = 0;
147enum EM_M32 = 1;
148enum EM_SPARC = 2;
149enum EM_386 = 3;
150enum EM_68K = 4;
151enum EM_88K = 5;
152enum EM_860 = 7;
153enum EM_MIPS = 8;
154enum EM_S370 = 9;
155enum EM_MIPS_RS3_LE = 10;
156
157enum EM_PARISC = 15;
158enum EM_VPP500 = 17;
159enum EM_SPARC32PLUS = 18;
160enum EM_960 = 19;
161enum EM_PPC = 20;
162enum EM_PPC64 = 21;
163enum EM_S390 = 22;
164
165enum EM_V800 = 36;
166enum EM_FR20 = 37;
167enum EM_RH32 = 38;
168enum EM_RCE = 39;
169enum EM_ARM = 40;
170enum EM_FAKE_ALPHA = 41;
171enum EM_SH = 42;
172enum EM_SPARCV9 = 43;
173enum EM_TRICORE = 44;
174enum EM_ARC = 45;
175enum EM_H8_300 = 46;
176enum EM_H8_300H = 47;
177enum EM_H8S = 48;
178enum EM_H8_500 = 49;
179enum EM_IA_64 = 50;
180enum EM_MIPS_X = 51;
181enum EM_COLDFIRE = 52;
182enum EM_68HC12 = 53;
183enum EM_MMA = 54;
184enum EM_PCP = 55;
185enum EM_NCPU = 56;
186enum EM_NDR1 = 57;
187enum EM_STARCORE = 58;
188enum EM_ME16 = 59;
189enum EM_ST100 = 60;
190enum EM_TINYJ = 61;
191enum EM_X86_64 = 62;
192enum EM_PDSP = 63;
193
194enum EM_FX66 = 66;
195enum EM_ST9PLUS = 67;
196enum EM_ST7 = 68;
197enum EM_68HC16 = 69;
198enum EM_68HC11 = 70;
199enum EM_68HC08 = 71;
200enum EM_68HC05 = 72;
201enum EM_SVX = 73;
202enum EM_ST19 = 74;
203enum EM_VAX = 75;
204enum EM_CRIS = 76;
205enum EM_JAVELIN = 77;
206enum EM_FIREPATH = 78;
207enum EM_ZSP = 79;
208enum EM_MMIX = 80;
209enum EM_HUANY = 81;
210enum EM_PRISM = 82;
211enum EM_AVR = 83;
212enum EM_FR30 = 84;
213enum EM_D10V = 85;
214enum EM_D30V = 86;
215enum EM_V850 = 87;
216enum EM_M32R = 88;
217enum EM_MN10300 = 89;
218enum EM_MN10200 = 90;
219enum EM_PJ = 91;
220enum EM_OPENRISC = 92;
221enum EM_ARC_A5 = 93;
222enum EM_XTENSA = 94;
223enum EM_VIDEOCORE = 95;
224enum EM_TMM_GPP = 96;
225enum EM_NS32K = 97;
226enum EM_TPC = 98;
227enum EM_SNP1K = 99;
228enum EM_ST200 = 100;
229enum EM_IP2K = 101;
230enum EM_MAX = 102;
231enum EM_CR = 103;
232enum EM_F2MC16 = 104;
233enum EM_MSP430 = 105;
234enum EM_BLACKFIN = 106;
235enum EM_SE_C33 = 107;
236enum EM_SEP = 108;
237enum EM_ARCA = 109;
238enum EM_UNICORE = 110;
239enum EM_DXP = 112;
240enum EM_ALTERA_NIOS2 = 113;
241enum EM_CRX = 114;
242enum EM_XGATE = 115;
243enum EM_C166 = 116;
244enum EM_M16C = 117;
245enum EM_DSPIC30F = 118;
246enum EM_CE = 119;
247enum EM_M32C = 120;
248enum EM_res121 = 121;
249enum EM_res122 = 122;
250enum EM_res123 = 123;
251enum EM_res124 = 124;
252enum EM_res125 = 125;
253enum EM_res126 = 126;
254enum EM_res127 = 127;
255enum EM_res128 = 128;
256enum EM_res129 = 129;
257enum EM_res130 = 130;
258enum EM_TSK3000 = 131;
259enum EM_RS08 = 132;
260enum EM_res133 = 133;
261enum EM_ECOG2 = 134;
262enum EM_SCORE = 135;
263enum EM_SCORE7 = 135;
264enum EM_DSP24 = 136;
265enum EM_VIDEOCORE3 = 137;
266enum EM_LATTICEMICO32 = 138;
267enum EM_SE_C17 = 139;
268enum EM_TI_C6000 = 140;
269enum EM_TI_C2000 = 141;
270enum EM_TI_C5500 = 142;
271enum EM_TI_ARP32 = 143;
272enum EM_TI_PRU = 144;
273enum EM_MMDSP_PLUS = 160;
274enum EM_CYPRESS_M8C = 161;
275enum EM_R32C = 162;
276enum EM_TRIMEDIA = 163;
277enum EM_QDSP6 = 164;
278enum EM_8051 = 165;
279enum EM_STXP7X = 166;
280enum EM_NDS32 = 167;
281enum EM_ECOG1 = 168;
282enum EM_ECOG1X = 168;
283enum EM_MAXQ30 = 169;
284enum EM_XIMO16 = 170;
285enum EM_MANIK = 171;
286enum EM_CRAYNV2 = 172;
287enum EM_RX = 173;
288enum EM_METAG = 174;
289enum EM_MCST_ELBRUS = 175;
290enum EM_ECOG16 = 176;
291enum EM_CR16 = 177;
292enum EM_ETPU = 178;
293enum EM_SLE9X = 179;
294enum EM_L1OM = 180;
295enum EM_K1OM = 181;
296enum EM_INTEL182 = 182;
297enum EM_AARCH64 = 183;
298enum EM_AVR32 = 185;
299enum EM_STM8 = 186;
300enum EM_TILE64 = 187;
301enum EM_TILEPRO = 188;
302enum EM_MICROBLAZE = 189;
303enum EM_CUDA = 190;
304enum EM_TILEGX = 191;
305enum EM_CLOUDSHIELD = 192;
306enum EM_COREA_1ST = 193;
307enum EM_COREA_2ND = 194;
308enum EM_ARCV2 = 195;
309enum EM_OPEN8 = 196;
310enum EM_RL78 = 197;
311enum EM_VIDEOCORE5 = 198;
312enum EM_78KOR = 199;
313enum EM_56800EX = 200;
314enum EM_BA1 = 201;
315enum EM_BA2 = 202;
316enum EM_XCORE = 203;
317enum EM_MCHP_PIC = 204;
318enum EM_INTELGT = 205;
319
320enum EM_KM32 = 210;
321enum EM_KMX32 = 211;
322enum EM_EMX16 = 212;
323enum EM_EMX8 = 213;
324enum EM_KVARC = 214;
325enum EM_CDP = 215;
326enum EM_COGE = 216;
327enum EM_COOL = 217;
328enum EM_NORC = 218;
329enum EM_CSR_KALIMBA = 219;
330enum EM_Z80 = 220;
331enum EM_VISIUM = 221;
332enum EM_FT32 = 222;
333enum EM_MOXIE = 223;
334enum EM_AMDGPU = 224;
335
336enum EM_RISCV = 243;
337
338enum EM_BPF = 247;
339enum EM_CSKY = 252;
340
341enum EM_NUM = 253;
342
343enum EM_ALPHA = 0x9026;
344
345enum EV_NONE = 0;
346enum EV_CURRENT = 1;
347enum EV_NUM = 2;
348
349struct Elf32_Shdr
350{
351 Elf32_Word sh_name;
352 Elf32_Word sh_type;
353 Elf32_Word sh_flags;
354 Elf32_Addr sh_addr;
355 Elf32_Off sh_offset;
356 Elf32_Word sh_size;
357 Elf32_Word sh_link;
358 Elf32_Word sh_info;
359 Elf32_Word sh_addralign;
360 Elf32_Word sh_entsize;
361}
362
363struct Elf64_Shdr
364{
365 Elf64_Word sh_name;
366 Elf64_Word sh_type;
367 Elf64_Xword sh_flags;
368 Elf64_Addr sh_addr;
369 Elf64_Off sh_offset;
370 Elf64_Xword sh_size;
371 Elf64_Word sh_link;
372 Elf64_Word sh_info;
373 Elf64_Xword sh_addralign;
374 Elf64_Xword sh_entsize;
375}
376
377enum SHN_UNDEF = 0;
378enum SHN_LORESERVE = 0xff00;
379enum SHN_LOPROC = 0xff00;
380enum SHN_BEFORE = 0xff00;
381enum SHN_AFTER = 0xff01;
382enum SHN_HIPROC = 0xff1f;
383enum SHN_LOOS = 0xff20;
384enum SHN_HIOS = 0xff3f;
385enum SHN_ABS = 0xfff1;
386enum SHN_COMMON = 0xfff2;
387enum SHN_XINDEX = 0xffff;
388enum SHN_HIRESERVE = 0xffff;
389
390enum SHT_NULL = 0;
391enum SHT_PROGBITS = 1;
392enum SHT_SYMTAB = 2;
393enum SHT_STRTAB = 3;
394enum SHT_RELA = 4;
395enum SHT_HASH = 5;
396enum SHT_DYNAMIC = 6;
397enum SHT_NOTE = 7;
398enum SHT_NOBITS = 8;
399enum SHT_REL = 9;
400enum SHT_SHLIB = 10;
401enum SHT_DYNSYM = 11;
402enum SHT_INIT_ARRAY = 14;
403enum SHT_FINI_ARRAY = 15;
404enum SHT_PREINIT_ARRAY = 16;
405enum SHT_GROUP = 17;
406enum SHT_SYMTAB_SHNDX = 18;
407enum SHT_NUM = 19;
408enum SHT_LOOS = 0x60000000;
409enum SHT_GNU_ATTRIBUTES = 0x6ffffff5;
410enum SHT_GNU_HASH = 0x6ffffff6;
411enum SHT_GNU_LIBLIST = 0x6ffffff7;
412enum SHT_CHECKSUM = 0x6ffffff8;
413enum SHT_LOSUNW = 0x6ffffffa;
414enum SHT_SUNW_move = 0x6ffffffa;
415enum SHT_SUNW_COMDAT = 0x6ffffffb;
416enum SHT_SUNW_syminfo = 0x6ffffffc;
417enum SHT_GNU_verdef = 0x6ffffffd;
418enum SHT_GNU_verneed = 0x6ffffffe;
419enum SHT_GNU_versym = 0x6fffffff;
420enum SHT_HISUNW = 0x6fffffff;
421enum SHT_HIOS = 0x6fffffff;
422enum SHT_LOPROC = 0x70000000;
423enum SHT_HIPROC = 0x7fffffff;
424enum SHT_LOUSER = 0x80000000;
425enum SHT_HIUSER = 0x8fffffff;
426
427enum SHF_WRITE = (1 << 0);
428enum SHF_ALLOC = (1 << 1);
429enum SHF_EXECINSTR = (1 << 2);
430enum SHF_MERGE = (1 << 4);
431enum SHF_STRINGS = (1 << 5);
432enum SHF_INFO_LINK = (1 << 6);
433enum SHF_LINK_ORDER = (1 << 7);
434enum SHF_OS_NONCONFORMING = (1 << 8);
435enum SHF_GROUP = (1 << 9);
436enum SHF_TLS = (1 << 10);
437enum SHF_COMPRESSED = (1 << 11);
438enum SHF_MASKOS = 0x0ff00000;
439enum SHF_MASKPROC = 0xf0000000;
440enum SHF_ORDERED = (1 << 30);
441enum SHF_EXCLUDE = (1 << 31);
442enum GRP_COMDAT = 0x1;
443
444struct Elf32_Sym
445{
446 Elf32_Word st_name;
447 Elf32_Addr st_value;
448 Elf32_Word st_size;
449 ubyte st_info;
450 ubyte st_other;
451 Elf32_Section st_shndx;
452}
453
454struct Elf64_Sym
455{
456 Elf64_Word st_name;
457 ubyte st_info;
458 ubyte st_other;
459 Elf64_Section st_shndx;
460 Elf64_Addr st_value;
461 Elf64_Xword st_size;
462}
463
464struct Elf32_Syminfo
465{
466 Elf32_Half si_boundto;
467 Elf32_Half si_flags;
468}
469
470struct Elf64_Syminfo
471{
472 Elf64_Half si_boundto;
473 Elf64_Half si_flags;
474}
475
476enum SYMINFO_BT_SELF = 0xffff;
477enum SYMINFO_BT_PARENT = 0xfffe;
478enum SYMINFO_BT_LOWRESERVE = 0xff00;
479
480enum SYMINFO_FLG_DIRECT = 0x0001;
481enum SYMINFO_FLG_PASSTHRU = 0x0002;
482enum SYMINFO_FLG_COPY = 0x0004;
483enum SYMINFO_FLG_LAZYLOAD = 0x0008;
484
485enum SYMINFO_NONE = 0;
486enum SYMINFO_CURRENT = 1;
487enum SYMINFO_NUM = 2;
488
489extern (D)
490{
491 auto ELF32_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
492 auto ELF32_ST_TYPE(T)(T val) { return val & 0xf; }
493 auto ELF32_ST_INFO(B, T)(B bind, T type) { return (bind << 4) + (type & 0xf); }
494 alias ELF32_ST_BIND ELF64_ST_BIND;
495 alias ELF32_ST_TYPE ELF64_ST_TYPE;
496 alias ELF32_ST_INFO ELF64_ST_INFO;
497}
498
499enum STB_LOCAL = 0;
500enum STB_GLOBAL = 1;
501enum STB_WEAK = 2;
502enum STB_NUM = 3;
503enum STB_LOOS = 10;
504enum STB_GNU_UNIQUE = 10;
505enum STB_HIOS = 12;
506enum STB_LOPROC = 13;
507enum STB_HIPROC = 15;
508
509enum STT_NOTYPE = 0;
510enum STT_OBJECT = 1;
511enum STT_FUNC = 2;
512enum STT_SECTION = 3;
513enum STT_FILE = 4;
514enum STT_COMMON = 5;
515enum STT_TLS = 6;
516enum STT_NUM = 7;
517enum STT_LOOS = 10;
518enum STT_GNU_IFUNC = 10;
519enum STT_HIOS = 12;
520enum STT_LOPROC = 13;
521enum STT_HIPROC = 15;
522
523enum STN_UNDEF = 0;
524
525enum STV_DEFAULT = 0;
526enum STV_INTERNAL = 1;
527enum STV_HIDDEN = 2;
528enum STV_PROTECTED = 3;
529
530struct Elf32_Rel
531{
532 Elf32_Addr r_offset;
533 Elf32_Word r_info;
534}
535
536struct Elf64_Rel
537{
538 Elf64_Addr r_offset;
539 Elf64_Xword r_info;
540}
541
542struct Elf32_Rela
543{
544 Elf32_Addr r_offset;
545 Elf32_Word r_info;
546 Elf32_Sword r_addend;
547}
548
549struct Elf64_Rela
550{
551 Elf64_Addr r_offset;
552 Elf64_Xword r_info;
553 Elf64_Sxword r_addend;
554}
555
556extern (D)
557{
558 auto ELF32_R_SYM(V)(V val) { return val >> 8; }
559 auto ELF32_R_TYPE(V)(V val) { return val & 0xff; }
560 auto ELF32_R_INFO(S, T)(S sym, T type) { return (sym << 8) + (type & 0xff); }
561
562 auto ELF64_R_SYM(I)(I i) { return i >> 32; }
563 auto ELF64_R_TYPE(I)(I i) { return i & 0xffffffff; }
564 auto ELF64_R_INFO(S, T)(S sym, T type) { return (sym << 32) + (type); }
565}
566
567struct Elf32_Phdr
568{
569 Elf32_Word p_type;
570 Elf32_Off p_offset;
571 Elf32_Addr p_vaddr;
572 Elf32_Addr p_paddr;
573 Elf32_Word p_filesz;
574 Elf32_Word p_memsz;
575 Elf32_Word p_flags;
576 Elf32_Word p_align;
577}
578
579struct Elf64_Phdr
580{
581 Elf64_Word p_type;
582 Elf64_Word p_flags;
583 Elf64_Off p_offset;
584 Elf64_Addr p_vaddr;
585 Elf64_Addr p_paddr;
586 Elf64_Xword p_filesz;
587 Elf64_Xword p_memsz;
588 Elf64_Xword p_align;
589}
590
591enum PN_XNUM = 0xffff;
592
593enum PT_NULL = 0;
594enum PT_LOAD = 1;
595enum PT_DYNAMIC = 2;
596enum PT_INTERP = 3;
597enum PT_NOTE = 4;
598enum PT_SHLIB = 5;
599enum PT_PHDR = 6;
600enum PT_TLS = 7;
601enum PT_NUM = 8;
602enum PT_LOOS = 0x60000000;
603enum PT_GNU_EH_FRAME = 0x6474e550;
604enum PT_GNU_STACK = 0x6474e551;
605enum PT_GNU_RELRO = 0x6474e552;
606enum PT_LOSUNW = 0x6ffffffa;
607enum PT_SUNWBSS = 0x6ffffffa;
608enum PT_SUNWSTACK = 0x6ffffffb;
609enum PT_HISUNW = 0x6fffffff;
610enum PT_HIOS = 0x6fffffff;
611enum PT_LOPROC = 0x70000000;
612enum PT_HIPROC = 0x7fffffff;
613
614enum PF_X = (1 << 0);
615enum PF_W = (1 << 1);
616enum PF_R = (1 << 2);
617enum PF_MASKOS = 0x0ff00000;
618enum PF_MASKPROC = 0xf0000000;
619
620struct Elf32_Dyn
621{
622 Elf32_Sword d_tag;
623 union _d_un
624 {
625 Elf32_Word d_val;
626 Elf32_Addr d_ptr;
627 } _d_un d_un;
628}
629
630struct Elf64_Dyn
631{
632 Elf64_Sxword d_tag;
633 union _d_un
634 {
635 Elf64_Xword d_val;
636 Elf64_Addr d_ptr;
637 } _d_un d_un;
638}
639
640enum DT_NULL = 0;
641enum DT_NEEDED = 1;
642enum DT_PLTRELSZ = 2;
643enum DT_PLTGOT = 3;
644enum DT_HASH = 4;
645enum DT_STRTAB = 5;
646enum DT_SYMTAB = 6;
647enum DT_RELA = 7;
648enum DT_RELASZ = 8;
649enum DT_RELAENT = 9;
650enum DT_STRSZ = 10;
651enum DT_SYMENT = 11;
652enum DT_INIT = 12;
653enum DT_FINI = 13;
654enum DT_SONAME = 14;
655enum DT_RPATH = 15;
656enum DT_SYMBOLIC = 16;
657enum DT_REL = 17;
658enum DT_RELSZ = 18;
659enum DT_RELENT = 19;
660enum DT_PLTREL = 20;
661enum DT_DEBUG = 21;
662enum DT_TEXTREL = 22;
663enum DT_JMPREL = 23;
664enum DT_BIND_NOW = 24;
665enum DT_INIT_ARRAY = 25;
666enum DT_FINI_ARRAY = 26;
667enum DT_INIT_ARRAYSZ = 27;
668enum DT_FINI_ARRAYSZ = 28;
669enum DT_RUNPATH = 29;
670enum DT_FLAGS = 30;
671enum DT_ENCODING = 32;
672enum DT_PREINIT_ARRAY = 32;
673enum DT_PREINIT_ARRAYSZ = 33;
674enum DT_NUM = 34;
675enum DT_LOOS = 0x6000000d;
676enum DT_HIOS = 0x6ffff000;
677enum DT_LOPROC = 0x70000000;
678enum DT_HIPROC = 0x7fffffff;
679enum DT_PROCNUM = DT_MIPS_NUM;
680enum DT_VALRNGLO = 0x6ffffd00;
681enum DT_GNU_PRELINKED = 0x6ffffdf5;
682enum DT_GNU_CONFLICTSZ = 0x6ffffdf6;
683enum DT_GNU_LIBLISTSZ = 0x6ffffdf7;
684enum DT_CHECKSUM = 0x6ffffdf8;
685enum DT_PLTPADSZ = 0x6ffffdf9;
686enum DT_MOVEENT = 0x6ffffdfa;
687enum DT_MOVESZ = 0x6ffffdfb;
688enum DT_FEATURE_1 = 0x6ffffdfc;
689enum DT_POSFLAG_1 = 0x6ffffdfd;
690enum DT_SYMINSZ = 0x6ffffdfe;
691enum DT_SYMINENT = 0x6ffffdff;
692enum DT_VALRNGHI = 0x6ffffdff;
693extern (D) auto DT_VALTAGIDX(T)(T tag)
694{
695 return DT_VALRNGHI - tag;
696}
697enum DT_VALNUM = 12;
698enum DT_ADDRRNGLO = 0x6ffffe00;
699enum DT_GNU_HASH = 0x6ffffef5;
700enum DT_TLSDESC_PLT = 0x6ffffef6;
701enum DT_TLSDESC_GOT = 0x6ffffef7;
702enum DT_GNU_CONFLICT = 0x6ffffef8;
703enum DT_GNU_LIBLIST = 0x6ffffef9;
704enum DT_CONFIG = 0x6ffffefa;
705enum DT_DEPAUDIT = 0x6ffffefb;
706enum DT_AUDIT = 0x6ffffefc;
707enum DT_PLTPAD = 0x6ffffefd;
708enum DT_MOVETAB = 0x6ffffefe;
709enum DT_SYMINFO = 0x6ffffeff;
710enum DT_ADDRRNGHI = 0x6ffffeff;
711extern (D) auto DT_ADDRTAGIDX(T)(T tag)
712{
713 return DT_ADDRRNGHI - tag;
714}
715enum DT_ADDRNUM = 11;
716enum DT_VERSYM = 0x6ffffff0;
717
718enum DT_RELACOUNT = 0x6ffffff9;
719enum DT_RELCOUNT = 0x6ffffffa;
720enum DT_FLAGS_1 = 0x6ffffffb;
721enum DT_VERDEF = 0x6ffffffc;
722enum DT_VERDEFNUM = 0x6ffffffd;
723enum DT_VERNEED = 0x6ffffffe;
724enum DT_VERNEEDNUM = 0x6fffffff;
725extern (D) auto DT_VERSIONTAGIDX(T)(T tag)
726{
727 return DT_VERNEEDNUM - tag;
728}
729enum DT_VERSIONTAGNUM = 16;
730enum DT_AUXILIARY = 0x7ffffffd;
731enum DT_FILTER = 0x7fffffff;
732extern (D) auto DT_EXTRATAGIDX(T)(T tag)
733{
734 return cast(Elf32_Word)(-(cast(Elf32_Sword)(tag) <<1>>1)-1);
735}
736enum DT_EXTRANUM = 3;
737enum DF_ORIGIN = 0x00000001;
738enum DF_SYMBOLIC = 0x00000002;
739enum DF_TEXTREL = 0x00000004;
740enum DF_BIND_NOW = 0x00000008;
741enum DF_STATIC_TLS = 0x00000010;
742enum DF_1_NOW = 0x00000001;
743enum DF_1_GLOBAL = 0x00000002;
744enum DF_1_GROUP = 0x00000004;
745enum DF_1_NODELETE = 0x00000008;
746enum DF_1_LOADFLTR = 0x00000010;
747enum DF_1_INITFIRST = 0x00000020;
748enum DF_1_NOOPEN = 0x00000040;
749enum DF_1_ORIGIN = 0x00000080;
750enum DF_1_DIRECT = 0x00000100;
751enum DF_1_TRANS = 0x00000200;
752enum DF_1_INTERPOSE = 0x00000400;
753enum DF_1_NODEFLIB = 0x00000800;
754enum DF_1_NODUMP = 0x00001000;
755enum DF_1_CONFALT = 0x00002000;
756enum DF_1_ENDFILTEE = 0x00004000;
757enum DF_1_DISPRELDNE = 0x00008000;
758enum DF_1_DISPRELPND = 0x00010000;
759enum DF_1_NODIRECT = 0x00020000;
760enum DF_1_IGNMULDEF = 0x00040000;
761enum DF_1_NOKSYMS = 0x00080000;
762enum DF_1_NOHDR = 0x00100000;
763enum DF_1_EDITED = 0x00200000;
764enum DF_1_NORELOC = 0x00400000;
765enum DF_1_SYMINTPOSE = 0x00800000;
766enum DF_1_GLOBAUDIT = 0x01000000;
767enum DF_1_SINGLETON = 0x02000000;
768enum DTF_1_PARINIT = 0x00000001;
769enum DTF_1_CONFEXP = 0x00000002;
770enum DF_P1_LAZYLOAD = 0x00000001;
771enum DF_P1_GROUPPERM = 0x00000002;
772
773struct Elf32_Verdef
774{
775 Elf32_Half vd_version;
776 Elf32_Half vd_flags;
777 Elf32_Half vd_ndx;
778 Elf32_Half vd_cnt;
779 Elf32_Word vd_hash;
780 Elf32_Word vd_aux;
781 Elf32_Word vd_next;
782}
783
784struct Elf64_Verdef
785{
786 Elf64_Half vd_version;
787 Elf64_Half vd_flags;
788 Elf64_Half vd_ndx;
789 Elf64_Half vd_cnt;
790 Elf64_Word vd_hash;
791 Elf64_Word vd_aux;
792 Elf64_Word vd_next;
793}
794enum VER_DEF_NONE = 0;
795enum VER_DEF_CURRENT = 1;
796enum VER_DEF_NUM = 2;
797enum VER_FLG_BASE = 0x1;
798enum VER_FLG_WEAK = 0x2;
799enum VER_NDX_LOCAL = 0;
800enum VER_NDX_GLOBAL = 1;
801enum VER_NDX_LORESERVE = 0xff00;
802enum VER_NDX_ELIMINATE = 0xff01;
803
804struct Elf32_Verdaux
805{
806 Elf32_Word vda_name;
807 Elf32_Word vda_next;
808}
809
810struct Elf64_Verdaux
811{
812 Elf64_Word vda_name;
813 Elf64_Word vda_next;
814}
815
816struct Elf32_Verneed
817{
818 Elf32_Half vn_version;
819 Elf32_Half vn_cnt;
820 Elf32_Word vn_file;
821 Elf32_Word vn_aux;
822 Elf32_Word vn_next;
823}
824
825struct Elf64_Verneed
826{
827 Elf64_Half vn_version;
828 Elf64_Half vn_cnt;
829 Elf64_Word vn_file;
830 Elf64_Word vn_aux;
831 Elf64_Word vn_next;
832}
833enum VER_NEED_NONE = 0;
834enum VER_NEED_CURRENT = 1;
835enum VER_NEED_NUM = 2;
836
837struct Elf32_Vernaux
838{
839 Elf32_Word vna_hash;
840 Elf32_Half vna_flags;
841 Elf32_Half vna_other;
842 Elf32_Word vna_name;
843 Elf32_Word vna_next;
844}
845
846struct Elf64_Vernaux
847{
848 Elf64_Word vna_hash;
849 Elf64_Half vna_flags;
850 Elf64_Half vna_other;
851 Elf64_Word vna_name;
852 Elf64_Word vna_next;
853}
854
855enum ELF_NOTE_SOLARIS = "SUNW Solaris";
856enum ELF_NOTE_GNU = "GNU";
857enum ELF_NOTE_PAGESIZE_HINT = 1;
858enum ELF_NOTE_ABI = 1;
859enum ELF_NOTE_OS_LINUX = 0;
860enum ELF_NOTE_OS_GNU = 1;
861enum ELF_NOTE_OS_SOLARIS2 = 2;
862enum ELF_NOTE_OS_FREEBSD = 3;
863
864struct Elf32_Move
865{
866 Elf32_Xword m_value;
867 Elf32_Word m_info;
868 Elf32_Word m_poffset;
869 Elf32_Half m_repeat;
870 Elf32_Half m_stride;
871}
872
873struct Elf64_Move
874{
875 Elf64_Xword m_value;
876 Elf64_Xword m_info;
877 Elf64_Xword m_poffset;
878 Elf64_Half m_repeat;
879 Elf64_Half m_stride;
880}
881extern (D)
882{
883 auto ELF32_M_SYM(I)(I info) { return info >> 8; }
884 auto ELF32_M_SIZE(I)(I info) { return cast(ubyte)info; }
885 auto ELF32_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubyte)size; }
886}
887
888alias ELF32_M_SYM ELF64_M_SYM;
889alias ELF32_M_SIZE ELF64_M_SIZE;
890alias ELF32_M_INFO ELF64_M_INFO;
891enum EF_CPU32 = 0x00810000;
892
893enum R_68K_NONE = 0;
894enum R_68K_32 = 1;
895enum R_68K_16 = 2;
896enum R_68K_8 = 3;
897enum R_68K_PC32 = 4;
898enum R_68K_PC16 = 5;
899enum R_68K_PC8 = 6;
900enum R_68K_GOT32 = 7;
901enum R_68K_GOT16 = 8;
902enum R_68K_GOT8 = 9;
903enum R_68K_GOT32O = 10;
904enum R_68K_GOT16O = 11;
905enum R_68K_GOT8O = 12;
906enum R_68K_PLT32 = 13;
907enum R_68K_PLT16 = 14;
908enum R_68K_PLT8 = 15;
909enum R_68K_PLT32O = 16;
910enum R_68K_PLT16O = 17;
911enum R_68K_PLT8O = 18;
912enum R_68K_COPY = 19;
913enum R_68K_GLOB_DAT = 20;
914enum R_68K_JMP_SLOT = 21;
915enum R_68K_RELATIVE = 22;
916enum R_68K_TLS_GD32 = 25;
917enum R_68K_TLS_GD16 = 26;
918enum R_68K_TLS_GD8 = 27;
919enum R_68K_TLS_LDM32 = 28;
920enum R_68K_TLS_LDM16 = 29;
921enum R_68K_TLS_LDM8 = 30;
922enum R_68K_TLS_LDO32 = 31;
923enum R_68K_TLS_LDO16 = 32;
924enum R_68K_TLS_LDO8 = 33;
925enum R_68K_TLS_IE32 = 34;
926enum R_68K_TLS_IE16 = 35;
927enum R_68K_TLS_IE8 = 36;
928enum R_68K_TLS_LE32 = 37;
929enum R_68K_TLS_LE16 = 38;
930enum R_68K_TLS_LE8 = 39;
931enum R_68K_TLS_DTPMOD32 = 40;
932enum R_68K_TLS_DTPREL32 = 41;
933enum R_68K_TLS_TPREL32 = 42;
934enum R_68K_NUM = 43;
935
936enum R_386_NONE = 0;
937enum R_386_32 = 1;
938enum R_386_PC32 = 2;
939enum R_386_GOT32 = 3;
940enum R_386_PLT32 = 4;
941enum R_386_COPY = 5;
942enum R_386_GLOB_DAT = 6;
943enum R_386_JMP_SLOT = 7;
944enum R_386_RELATIVE = 8;
945enum R_386_GOTOFF = 9;
946enum R_386_GOTPC = 10;
947enum R_386_32PLT = 11;
948enum R_386_TLS_TPOFF = 14;
949enum R_386_TLS_IE = 15;
950enum R_386_TLS_GOTIE = 16;
951enum R_386_TLS_LE = 17;
952enum R_386_TLS_GD = 18;
953enum R_386_TLS_LDM = 19;
954enum R_386_16 = 20;
955enum R_386_PC16 = 21;
956enum R_386_8 = 22;
957enum R_386_PC8 = 23;
958enum R_386_TLS_GD_32 = 24;
959enum R_386_TLS_GD_PUSH = 25;
960enum R_386_TLS_GD_CALL = 26;
961enum R_386_TLS_GD_POP = 27;
962enum R_386_TLS_LDM_32 = 28;
963enum R_386_TLS_LDM_PUSH = 29;
964enum R_386_TLS_LDM_CALL = 30;
965enum R_386_TLS_LDM_POP = 31;
966enum R_386_TLS_LDO_32 = 32;
967enum R_386_TLS_IE_32 = 33;
968enum R_386_TLS_LE_32 = 34;
969enum R_386_TLS_DTPMOD32 = 35;
970enum R_386_TLS_DTPOFF32 = 36;
971enum R_386_TLS_TPOFF32 = 37;
972enum R_386_SIZE32 = 38;
973enum R_386_TLS_GOTDESC = 39;
974enum R_386_TLS_DESC_CALL = 40;
975enum R_386_TLS_DESC = 41;
976enum R_386_IRELATIVE = 42;
977enum R_386_NUM = 43;
978
979enum STT_SPARC_REGISTER = 13;
980
981enum EF_SPARCV9_MM = 3;
982enum EF_SPARCV9_TSO = 0;
983enum EF_SPARCV9_PSO = 1;
984enum EF_SPARCV9_RMO = 2;
985enum EF_SPARC_LEDATA = 0x800000;
986enum EF_SPARC_EXT_MASK = 0xFFFF00;
987enum EF_SPARC_32PLUS = 0x000100;
988enum EF_SPARC_SUN_US1 = 0x000200;
989enum EF_SPARC_HAL_R1 = 0x000400;
990enum EF_SPARC_SUN_US3 = 0x000800;
991
992enum R_SPARC_NONE = 0;
993enum R_SPARC_8 = 1;
994enum R_SPARC_16 = 2;
995enum R_SPARC_32 = 3;
996enum R_SPARC_DISP8 = 4;
997enum R_SPARC_DISP16 = 5;
998enum R_SPARC_DISP32 = 6;
999enum R_SPARC_WDISP30 = 7;
1000enum R_SPARC_WDISP22 = 8;
1001enum R_SPARC_HI22 = 9;
1002enum R_SPARC_22 = 10;
1003enum R_SPARC_13 = 11;
1004enum R_SPARC_LO10 = 12;
1005enum R_SPARC_GOT10 = 13;
1006enum R_SPARC_GOT13 = 14;
1007enum R_SPARC_GOT22 = 15;
1008enum R_SPARC_PC10 = 16;
1009enum R_SPARC_PC22 = 17;
1010enum R_SPARC_WPLT30 = 18;
1011enum R_SPARC_COPY = 19;
1012enum R_SPARC_GLOB_DAT = 20;
1013enum R_SPARC_JMP_SLOT = 21;
1014enum R_SPARC_RELATIVE = 22;
1015enum R_SPARC_UA32 = 23;
1016
1017enum R_SPARC_PLT32 = 24;
1018enum R_SPARC_HIPLT22 = 25;
1019enum R_SPARC_LOPLT10 = 26;
1020enum R_SPARC_PCPLT32 = 27;
1021enum R_SPARC_PCPLT22 = 28;
1022enum R_SPARC_PCPLT10 = 29;
1023enum R_SPARC_10 = 30;
1024enum R_SPARC_11 = 31;
1025enum R_SPARC_64 = 32;
1026enum R_SPARC_OLO10 = 33;
1027enum R_SPARC_HH22 = 34;
1028enum R_SPARC_HM10 = 35;
1029enum R_SPARC_LM22 = 36;
1030enum R_SPARC_PC_HH22 = 37;
1031enum R_SPARC_PC_HM10 = 38;
1032enum R_SPARC_PC_LM22 = 39;
1033enum R_SPARC_WDISP16 = 40;
1034enum R_SPARC_WDISP19 = 41;
1035enum R_SPARC_GLOB_JMP = 42;
1036enum R_SPARC_7 = 43;
1037enum R_SPARC_5 = 44;
1038enum R_SPARC_6 = 45;
1039enum R_SPARC_DISP64 = 46;
1040enum R_SPARC_PLT64 = 47;
1041enum R_SPARC_HIX22 = 48;
1042enum R_SPARC_LOX10 = 49;
1043enum R_SPARC_H44 = 50;
1044enum R_SPARC_M44 = 51;
1045enum R_SPARC_L44 = 52;
1046enum R_SPARC_REGISTER = 53;
1047enum R_SPARC_UA64 = 54;
1048enum R_SPARC_UA16 = 55;
1049enum R_SPARC_TLS_GD_HI22 = 56;
1050enum R_SPARC_TLS_GD_LO10 = 57;
1051enum R_SPARC_TLS_GD_ADD = 58;
1052enum R_SPARC_TLS_GD_CALL = 59;
1053enum R_SPARC_TLS_LDM_HI22 = 60;
1054enum R_SPARC_TLS_LDM_LO10 = 61;
1055enum R_SPARC_TLS_LDM_ADD = 62;
1056enum R_SPARC_TLS_LDM_CALL = 63;
1057enum R_SPARC_TLS_LDO_HIX22 = 64;
1058enum R_SPARC_TLS_LDO_LOX10 = 65;
1059enum R_SPARC_TLS_LDO_ADD = 66;
1060enum R_SPARC_TLS_IE_HI22 = 67;
1061enum R_SPARC_TLS_IE_LO10 = 68;
1062enum R_SPARC_TLS_IE_LD = 69;
1063enum R_SPARC_TLS_IE_LDX = 70;
1064enum R_SPARC_TLS_IE_ADD = 71;
1065enum R_SPARC_TLS_LE_HIX22 = 72;
1066enum R_SPARC_TLS_LE_LOX10 = 73;
1067enum R_SPARC_TLS_DTPMOD32 = 74;
1068enum R_SPARC_TLS_DTPMOD64 = 75;
1069enum R_SPARC_TLS_DTPOFF32 = 76;
1070enum R_SPARC_TLS_DTPOFF64 = 77;
1071enum R_SPARC_TLS_TPOFF32 = 78;
1072enum R_SPARC_TLS_TPOFF64 = 79;
1073enum R_SPARC_GOTDATA_HIX22 = 80;
1074enum R_SPARC_GOTDATA_LOX10 = 81;
1075enum R_SPARC_GOTDATA_OP_HIX22 = 82;
1076enum R_SPARC_GOTDATA_OP_LOX10 = 83;
1077enum R_SPARC_GOTDATA_OP = 84;
1078enum R_SPARC_H34 = 85;
1079enum R_SPARC_SIZE32 = 86;
1080enum R_SPARC_SIZE64 = 87;
1081enum R_SPARC_WDISP10 = 88;
1082enum R_SPARC_JMP_IREL = 248;
1083enum R_SPARC_IRELATIVE = 249;
1084enum R_SPARC_GNU_VTINHERIT = 250;
1085enum R_SPARC_GNU_VTENTRY = 251;
1086enum R_SPARC_REV32 = 252;
1087enum R_SPARC_NUM = 253;
1088
1089enum DT_SPARC_REGISTER = 0x70000001;
1090enum DT_SPARC_NUM = 2;
1091
1092enum EF_MIPS_NOREORDER = 1;
1093enum EF_MIPS_PIC = 2;
1094enum EF_MIPS_CPIC = 4;
1095enum EF_MIPS_XGOT = 8;
1096enum EF_MIPS_64BIT_WHIRL = 16;
1097enum EF_MIPS_ABI2 = 32;
1098enum EF_MIPS_ABI_ON32 = 64;
1099enum EF_MIPS_ARCH = 0xf0000000;
1100
1101enum EF_MIPS_ARCH_1 = 0x00000000;
1102enum EF_MIPS_ARCH_2 = 0x10000000;
1103enum EF_MIPS_ARCH_3 = 0x20000000;
1104enum EF_MIPS_ARCH_4 = 0x30000000;
1105enum EF_MIPS_ARCH_5 = 0x40000000;
1106enum EF_MIPS_ARCH_32 = 0x50000000;
1107enum EF_MIPS_ARCH_64 = 0x60000000;
1108enum EF_MIPS_ARCH_32R2 = 0x70000000;
1109enum EF_MIPS_ARCH_64R2 = 0x80000000;
1110
1111enum E_MIPS_ARCH_1 = EF_MIPS_ARCH_1;
1112enum E_MIPS_ARCH_2 = EF_MIPS_ARCH_2;
1113enum E_MIPS_ARCH_3 = EF_MIPS_ARCH_3;
1114enum E_MIPS_ARCH_4 = EF_MIPS_ARCH_4;
1115enum E_MIPS_ARCH_5 = EF_MIPS_ARCH_5;
1116enum E_MIPS_ARCH_32 = EF_MIPS_ARCH_32;
1117enum E_MIPS_ARCH_64 = EF_MIPS_ARCH_64;
1118
1119enum SHN_MIPS_ACOMMON = 0xff00;
1120enum SHN_MIPS_TEXT = 0xff01;
1121enum SHN_MIPS_DATA = 0xff02;
1122enum SHN_MIPS_SCOMMON = 0xff03;
1123enum SHN_MIPS_SUNDEFINED = 0xff04;
1124
1125enum SHT_MIPS_LIBLIST = 0x70000000;
1126enum SHT_MIPS_MSYM = 0x70000001;
1127enum SHT_MIPS_CONFLICT = 0x70000002;
1128enum SHT_MIPS_GPTAB = 0x70000003;
1129enum SHT_MIPS_UCODE = 0x70000004;
1130enum SHT_MIPS_DEBUG = 0x70000005;
1131enum SHT_MIPS_REGINFO = 0x70000006;
1132enum SHT_MIPS_PACKAGE = 0x70000007;
1133enum SHT_MIPS_PACKSYM = 0x70000008;
1134enum SHT_MIPS_RELD = 0x70000009;
1135enum SHT_MIPS_IFACE = 0x7000000b;
1136enum SHT_MIPS_CONTENT = 0x7000000c;
1137enum SHT_MIPS_OPTIONS = 0x7000000d;
1138enum SHT_MIPS_SHDR = 0x70000010;
1139enum SHT_MIPS_FDESC = 0x70000011;
1140enum SHT_MIPS_EXTSYM = 0x70000012;
1141enum SHT_MIPS_DENSE = 0x70000013;
1142enum SHT_MIPS_PDESC = 0x70000014;
1143enum SHT_MIPS_LOCSYM = 0x70000015;
1144enum SHT_MIPS_AUXSYM = 0x70000016;
1145enum SHT_MIPS_OPTSYM = 0x70000017;
1146enum SHT_MIPS_LOCSTR = 0x70000018;
1147enum SHT_MIPS_LINE = 0x70000019;
1148enum SHT_MIPS_RFDESC = 0x7000001a;
1149enum SHT_MIPS_DELTASYM = 0x7000001b;
1150enum SHT_MIPS_DELTAINST = 0x7000001c;
1151enum SHT_MIPS_DELTACLASS = 0x7000001d;
1152enum SHT_MIPS_DWARF = 0x7000001e;
1153enum SHT_MIPS_DELTADECL = 0x7000001f;
1154enum SHT_MIPS_SYMBOL_LIB = 0x70000020;
1155enum SHT_MIPS_EVENTS = 0x70000021;
1156enum SHT_MIPS_TRANSLATE = 0x70000022;
1157enum SHT_MIPS_PIXIE = 0x70000023;
1158enum SHT_MIPS_XLATE = 0x70000024;
1159enum SHT_MIPS_XLATE_DEBUG = 0x70000025;
1160enum SHT_MIPS_WHIRL = 0x70000026;
1161enum SHT_MIPS_EH_REGION = 0x70000027;
1162enum SHT_MIPS_XLATE_OLD = 0x70000028;
1163enum SHT_MIPS_PDR_EXCEPTION = 0x70000029;
1164
1165enum SHF_MIPS_GPREL = 0x10000000;
1166enum SHF_MIPS_MERGE = 0x20000000;
1167enum SHF_MIPS_ADDR = 0x40000000;
1168enum SHF_MIPS_STRINGS = 0x80000000;
1169enum SHF_MIPS_NOSTRIP = 0x08000000;
1170enum SHF_MIPS_LOCAL = 0x04000000;
1171enum SHF_MIPS_NAMES = 0x02000000;
1172enum SHF_MIPS_NODUPE = 0x01000000;
1173enum STO_MIPS_DEFAULT = 0x0;
1174enum STO_MIPS_INTERNAL = 0x1;
1175enum STO_MIPS_HIDDEN = 0x2;
1176enum STO_MIPS_PROTECTED = 0x3;
1177enum STO_MIPS_PLT = 0x8;
1178enum STO_MIPS_SC_ALIGN_UNUSED = 0xff;
1179enum STB_MIPS_SPLIT_COMMON = 13;
1180
1181union Elf32_gptab
1182{
1183 struct _gt_header
1184 {
1185 Elf32_Word gt_current_g_value;
1186 Elf32_Word gt_unused;
1187 } _gt_header gt_header;
1188 struct _gt_entry
1189 {
1190 Elf32_Word gt_g_value;
1191 Elf32_Word gt_bytes;
1192 } _gt_entry gt_entry;
1193}
1194
1195struct Elf32_RegInfo
1196{
1197 Elf32_Word ri_gprmask;
1198 Elf32_Word[4] ri_cprmask;
1199 Elf32_Sword ri_gp_value;
1200}
1201
1202struct Elf_Options
1203{
1204 ubyte kind;
1205 ubyte size;
1206 Elf32_Section section;
1207 Elf32_Word info;
1208}
1209
1210enum ODK_NULL = 0;
1211enum ODK_REGINFO = 1;
1212enum ODK_EXCEPTIONS = 2;
1213enum ODK_PAD = 3;
1214enum ODK_HWPATCH = 4;
1215enum ODK_FILL = 5;
1216enum ODK_TAGS = 6;
1217enum ODK_HWAND = 7;
1218enum ODK_HWOR = 8;
1219
1220enum OEX_FPU_MIN = 0x1f;
1221enum OEX_FPU_MAX = 0x1f00;
1222enum OEX_PAGE0 = 0x10000;
1223enum OEX_SMM = 0x20000;
1224enum OEX_FPDBUG = 0x40000;
1225enum OEX_PRECISEFP = OEX_FPDBUG;
1226enum OEX_DISMISS = 0x80000;
1227
1228enum OEX_FPU_INVAL = 0x10;
1229enum OEX_FPU_DIV0 = 0x08;
1230enum OEX_FPU_OFLO = 0x04;
1231enum OEX_FPU_UFLO = 0x02;
1232enum OEX_FPU_INEX = 0x01;
1233
1234enum OHW_R4KEOP = 0x1;
1235enum OHW_R8KPFETCH = 0x2;
1236enum OHW_R5KEOP = 0x4;
1237enum OHW_R5KCVTL = 0x8;
1238
1239enum OPAD_PREFIX = 0x1;
1240enum OPAD_POSTFIX = 0x2;
1241enum OPAD_SYMBOL = 0x4;
1242
1243struct Elf_Options_Hw
1244{
1245 Elf32_Word hwp_flags1;
1246 Elf32_Word hwp_flags2;
1247}
1248
1249enum OHWA0_R4KEOP_CHECKED = 0x00000001;
1250enum OHWA1_R4KEOP_CLEAN = 0x00000002;
1251
1252enum R_MIPS_NONE = 0;
1253enum R_MIPS_16 = 1;
1254enum R_MIPS_32 = 2;
1255enum R_MIPS_REL32 = 3;
1256enum R_MIPS_26 = 4;
1257enum R_MIPS_HI16 = 5;
1258enum R_MIPS_LO16 = 6;
1259enum R_MIPS_GPREL16 = 7;
1260enum R_MIPS_LITERAL = 8;
1261enum R_MIPS_GOT16 = 9;
1262enum R_MIPS_PC16 = 10;
1263enum R_MIPS_CALL16 = 11;
1264enum R_MIPS_GPREL32 = 12;
1265
1266enum R_MIPS_SHIFT5 = 16;
1267enum R_MIPS_SHIFT6 = 17;
1268enum R_MIPS_64 = 18;
1269enum R_MIPS_GOT_DISP = 19;
1270enum R_MIPS_GOT_PAGE = 20;
1271enum R_MIPS_GOT_OFST = 21;
1272enum R_MIPS_GOT_HI16 = 22;
1273enum R_MIPS_GOT_LO16 = 23;
1274enum R_MIPS_SUB = 24;
1275enum R_MIPS_INSERT_A = 25;
1276enum R_MIPS_INSERT_B = 26;
1277enum R_MIPS_DELETE = 27;
1278enum R_MIPS_HIGHER = 28;
1279enum R_MIPS_HIGHEST = 29;
1280enum R_MIPS_CALL_HI16 = 30;
1281enum R_MIPS_CALL_LO16 = 31;
1282enum R_MIPS_SCN_DISP = 32;
1283enum R_MIPS_REL16 = 33;
1284enum R_MIPS_ADD_IMMEDIATE = 34;
1285enum R_MIPS_PJUMP = 35;
1286enum R_MIPS_RELGOT = 36;
1287enum R_MIPS_JALR = 37;
1288enum R_MIPS_TLS_DTPMOD32 = 38;
1289enum R_MIPS_TLS_DTPREL32 = 39;
1290enum R_MIPS_TLS_DTPMOD64 = 40;
1291enum R_MIPS_TLS_DTPREL64 = 41;
1292enum R_MIPS_TLS_GD = 42;
1293enum R_MIPS_TLS_LDM = 43;
1294enum R_MIPS_TLS_DTPREL_HI16 = 44;
1295enum R_MIPS_TLS_DTPREL_LO16 = 45;
1296enum R_MIPS_TLS_GOTTPREL = 46;
1297enum R_MIPS_TLS_TPREL32 = 47;
1298enum R_MIPS_TLS_TPREL64 = 48;
1299enum R_MIPS_TLS_TPREL_HI16 = 49;
1300enum R_MIPS_TLS_TPREL_LO16 = 50;
1301enum R_MIPS_GLOB_DAT = 51;
1302enum R_MIPS_COPY = 126;
1303enum R_MIPS_JUMP_SLOT = 127;
1304enum R_MIPS_NUM = 128;
1305
1306enum PT_MIPS_REGINFO = 0x70000000;
1307enum PT_MIPS_RTPROC = 0x70000001;
1308enum PT_MIPS_OPTIONS = 0x70000002;
1309
1310enum PF_MIPS_LOCAL = 0x10000000;
1311
1312enum DT_MIPS_RLD_VERSION = 0x70000001;
1313enum DT_MIPS_TIME_STAMP = 0x70000002;
1314enum DT_MIPS_ICHECKSUM = 0x70000003;
1315enum DT_MIPS_IVERSION = 0x70000004;
1316enum DT_MIPS_FLAGS = 0x70000005;
1317enum DT_MIPS_BASE_ADDRESS = 0x70000006;
1318enum DT_MIPS_MSYM = 0x70000007;
1319enum DT_MIPS_CONFLICT = 0x70000008;
1320enum DT_MIPS_LIBLIST = 0x70000009;
1321enum DT_MIPS_LOCAL_GOTNO = 0x7000000a;
1322enum DT_MIPS_CONFLICTNO = 0x7000000b;
1323enum DT_MIPS_LIBLISTNO = 0x70000010;
1324enum DT_MIPS_SYMTABNO = 0x70000011;
1325enum DT_MIPS_UNREFEXTNO = 0x70000012;
1326enum DT_MIPS_GOTSYM = 0x70000013;
1327enum DT_MIPS_HIPAGENO = 0x70000014;
1328enum DT_MIPS_RLD_MAP = 0x70000016;
1329enum DT_MIPS_DELTA_CLASS = 0x70000017;
1330enum DT_MIPS_DELTA_CLASS_NO = 0x70000018;
1331enum DT_MIPS_DELTA_INSTANCE = 0x70000019;
1332enum DT_MIPS_DELTA_INSTANCE_NO = 0x7000001a;
1333enum DT_MIPS_DELTA_RELOC = 0x7000001b;
1334enum DT_MIPS_DELTA_RELOC_NO = 0x7000001c;
1335enum DT_MIPS_DELTA_SYM = 0x7000001d;
1336enum DT_MIPS_DELTA_SYM_NO = 0x7000001e;
1337enum DT_MIPS_DELTA_CLASSSYM = 0x70000020;
1338enum DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021;
1339enum DT_MIPS_CXX_FLAGS = 0x70000022;
1340enum DT_MIPS_PIXIE_INIT = 0x70000023;
1341enum DT_MIPS_SYMBOL_LIB = 0x70000024;
1342enum DT_MIPS_LOCALPAGE_GOTIDX = 0x70000025;
1343enum DT_MIPS_LOCAL_GOTIDX = 0x70000026;
1344enum DT_MIPS_HIDDEN_GOTIDX = 0x70000027;
1345enum DT_MIPS_PROTECTED_GOTIDX = 0x70000028;
1346enum DT_MIPS_OPTIONS = 0x70000029;
1347enum DT_MIPS_INTERFACE = 0x7000002a;
1348enum DT_MIPS_DYNSTR_ALIGN = 0x7000002b;
1349enum DT_MIPS_INTERFACE_SIZE = 0x7000002c;
1350enum DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002d;
1351enum DT_MIPS_PERF_SUFFIX = 0x7000002e;
1352enum DT_MIPS_COMPACT_SIZE = 0x7000002f;
1353enum DT_MIPS_GP_VALUE = 0x70000030;
1354enum DT_MIPS_AUX_DYNAMIC = 0x70000031;
1355enum DT_MIPS_PLTGOT = 0x70000032;
1356enum DT_MIPS_RWPLT = 0x70000034;
1357enum DT_MIPS_NUM = 0x35;
1358
1359enum RHF_NONE = 0;
1360enum RHF_QUICKSTART = (1 << 0);
1361enum RHF_NOTPOT = (1 << 1);
1362enum RHF_NO_LIBRARY_REPLACEMENT = (1 << 2);
1363enum RHF_NO_MOVE = (1 << 3);
1364enum RHF_SGI_ONLY = (1 << 4);
1365enum RHF_GUARANTEE_INIT = (1 << 5);
1366enum RHF_DELTA_C_PLUS_PLUS = (1 << 6);
1367enum RHF_GUARANTEE_START_INIT = (1 << 7);
1368enum RHF_PIXIE = (1 << 8);
1369enum RHF_DEFAULT_DELAY_LOAD = (1 << 9);
1370enum RHF_REQUICKSTART = (1 << 10);
1371enum RHF_REQUICKSTARTED = (1 << 11);
1372enum RHF_CORD = (1 << 12);
1373enum RHF_NO_UNRES_UNDEF = (1 << 13);
1374enum RHF_RLD_ORDER_SAFE = (1 << 14);
1375
1376struct Elf32_Lib
1377{
1378 Elf32_Word l_name;
1379 Elf32_Word l_time_stamp;
1380 Elf32_Word l_checksum;
1381 Elf32_Word l_version;
1382 Elf32_Word l_flags;
1383}
1384
1385struct Elf64_Lib
1386{
1387 Elf64_Word l_name;
1388 Elf64_Word l_time_stamp;
1389 Elf64_Word l_checksum;
1390 Elf64_Word l_version;
1391 Elf64_Word l_flags;
1392}
1393
1394enum LL_NONE = 0;
1395enum LL_EXACT_MATCH = (1 << 0);
1396enum LL_IGNORE_INT_VER = (1 << 1);
1397enum LL_REQUIRE_MINOR = (1 << 2);
1398enum LL_EXPORTS = (1 << 3);
1399enum LL_DELAY_LOAD = (1 << 4);
1400enum LL_DELTA = (1 << 5);
1401
1402alias Elf32_Addr Elf32_Conflict;
1403
1404enum EF_PARISC_TRAPNIL = 0x00010000;
1405enum EF_PARISC_EXT = 0x00020000;
1406enum EF_PARISC_LSB = 0x00040000;
1407enum EF_PARISC_WIDE = 0x00080000;
1408enum EF_PARISC_NO_KABP = 0x00100000;
1409enum EF_PARISC_LAZYSWAP = 0x00400000;
1410enum EF_PARISC_ARCH = 0x0000ffff;
1411
1412enum EFA_PARISC_1_0 = 0x020b;
1413enum EFA_PARISC_1_1 = 0x0210;
1414enum EFA_PARISC_2_0 = 0x0214;
1415
1416enum SHN_PARISC_ANSI_COMMON = 0xff00;
1417enum SHN_PARISC_HUGE_COMMON = 0xff01;
1418
1419enum SHT_PARISC_EXT = 0x70000000;
1420enum SHT_PARISC_UNWIND = 0x70000001;
1421enum SHT_PARISC_DOC = 0x70000002;
1422
1423enum SHF_PARISC_SHORT = 0x20000000;
1424enum SHF_PARISC_HUGE = 0x40000000;
1425enum SHF_PARISC_SBP = 0x80000000;
1426
1427enum STT_PARISC_MILLICODE = 13;
1428
1429enum STT_HP_OPAQUE = (STT_LOOS + 0x1);
1430enum STT_HP_STUB = (STT_LOOS + 0x2);
1431
1432enum R_PARISC_NONE = 0;
1433enum R_PARISC_DIR32 = 1;
1434enum R_PARISC_DIR21L = 2;
1435enum R_PARISC_DIR17R = 3;
1436enum R_PARISC_DIR17F = 4;
1437enum R_PARISC_DIR14R = 6;
1438enum R_PARISC_PCREL32 = 9;
1439enum R_PARISC_PCREL21L = 10;
1440enum R_PARISC_PCREL17R = 11;
1441enum R_PARISC_PCREL17F = 12;
1442enum R_PARISC_PCREL14R = 14;
1443enum R_PARISC_DPREL21L = 18;
1444enum R_PARISC_DPREL14R = 22;
1445enum R_PARISC_GPREL21L = 26;
1446enum R_PARISC_GPREL14R = 30;
1447enum R_PARISC_LTOFF21L = 34;
1448enum R_PARISC_LTOFF14R = 38;
1449enum R_PARISC_SECREL32 = 41;
1450enum R_PARISC_SEGBASE = 48;
1451enum R_PARISC_SEGREL32 = 49;
1452enum R_PARISC_PLTOFF21L = 50;
1453enum R_PARISC_PLTOFF14R = 54;
1454enum R_PARISC_LTOFF_FPTR32 = 57;
1455enum R_PARISC_LTOFF_FPTR21L = 58;
1456enum R_PARISC_LTOFF_FPTR14R = 62;
1457enum R_PARISC_FPTR64 = 64;
1458enum R_PARISC_PLABEL32 = 65;
1459enum R_PARISC_PLABEL21L = 66;
1460enum R_PARISC_PLABEL14R = 70;
1461enum R_PARISC_PCREL64 = 72;
1462enum R_PARISC_PCREL22F = 74;
1463enum R_PARISC_PCREL14WR = 75;
1464enum R_PARISC_PCREL14DR = 76;
1465enum R_PARISC_PCREL16F = 77;
1466enum R_PARISC_PCREL16WF = 78;
1467enum R_PARISC_PCREL16DF = 79;
1468enum R_PARISC_DIR64 = 80;
1469enum R_PARISC_DIR14WR = 83;
1470enum R_PARISC_DIR14DR = 84;
1471enum R_PARISC_DIR16F = 85;
1472enum R_PARISC_DIR16WF = 86;
1473enum R_PARISC_DIR16DF = 87;
1474enum R_PARISC_GPREL64 = 88;
1475enum R_PARISC_GPREL14WR = 91;
1476enum R_PARISC_GPREL14DR = 92;
1477enum R_PARISC_GPREL16F = 93;
1478enum R_PARISC_GPREL16WF = 94;
1479enum R_PARISC_GPREL16DF = 95;
1480enum R_PARISC_LTOFF64 = 96;
1481enum R_PARISC_LTOFF14WR = 99;
1482enum R_PARISC_LTOFF14DR = 100;
1483enum R_PARISC_LTOFF16F = 101;
1484enum R_PARISC_LTOFF16WF = 102;
1485enum R_PARISC_LTOFF16DF = 103;
1486enum R_PARISC_SECREL64 = 104;
1487enum R_PARISC_SEGREL64 = 112;
1488enum R_PARISC_PLTOFF14WR = 115;
1489enum R_PARISC_PLTOFF14DR = 116;
1490enum R_PARISC_PLTOFF16F = 117;
1491enum R_PARISC_PLTOFF16WF = 118;
1492enum R_PARISC_PLTOFF16DF = 119;
1493enum R_PARISC_LTOFF_FPTR64 = 120;
1494enum R_PARISC_LTOFF_FPTR14WR = 123;
1495enum R_PARISC_LTOFF_FPTR14DR = 124;
1496enum R_PARISC_LTOFF_FPTR16F = 125;
1497enum R_PARISC_LTOFF_FPTR16WF = 126;
1498enum R_PARISC_LTOFF_FPTR16DF = 127;
1499enum R_PARISC_LORESERVE = 128;
1500enum R_PARISC_COPY = 128;
1501enum R_PARISC_IPLT = 129;
1502enum R_PARISC_EPLT = 130;
1503enum R_PARISC_TPREL32 = 153;
1504enum R_PARISC_TPREL21L = 154;
1505enum R_PARISC_TPREL14R = 158;
1506enum R_PARISC_LTOFF_TP21L = 162;
1507enum R_PARISC_LTOFF_TP14R = 166;
1508enum R_PARISC_LTOFF_TP14F = 167;
1509enum R_PARISC_TPREL64 = 216;
1510enum R_PARISC_TPREL14WR = 219;
1511enum R_PARISC_TPREL14DR = 220;
1512enum R_PARISC_TPREL16F = 221;
1513enum R_PARISC_TPREL16WF = 222;
1514enum R_PARISC_TPREL16DF = 223;
1515enum R_PARISC_LTOFF_TP64 = 224;
1516enum R_PARISC_LTOFF_TP14WR = 227;
1517enum R_PARISC_LTOFF_TP14DR = 228;
1518enum R_PARISC_LTOFF_TP16F = 229;
1519enum R_PARISC_LTOFF_TP16WF = 230;
1520enum R_PARISC_LTOFF_TP16DF = 231;
1521enum R_PARISC_GNU_VTENTRY = 232;
1522enum R_PARISC_GNU_VTINHERIT = 233;
1523enum R_PARISC_TLS_GD21L = 234;
1524enum R_PARISC_TLS_GD14R = 235;
1525enum R_PARISC_TLS_GDCALL = 236;
1526enum R_PARISC_TLS_LDM21L = 237;
1527enum R_PARISC_TLS_LDM14R = 238;
1528enum R_PARISC_TLS_LDMCALL = 239;
1529enum R_PARISC_TLS_LDO21L = 240;
1530enum R_PARISC_TLS_LDO14R = 241;
1531enum R_PARISC_TLS_DTPMOD32 = 242;
1532enum R_PARISC_TLS_DTPMOD64 = 243;
1533enum R_PARISC_TLS_DTPOFF32 = 244;
1534enum R_PARISC_TLS_DTPOFF64 = 245;
1535enum R_PARISC_TLS_LE21L = R_PARISC_TPREL21L;
1536enum R_PARISC_TLS_LE14R = R_PARISC_TPREL14R;
1537enum R_PARISC_TLS_IE21L = R_PARISC_LTOFF_TP21L;
1538enum R_PARISC_TLS_IE14R = R_PARISC_LTOFF_TP14R;
1539enum R_PARISC_TLS_TPREL32 = R_PARISC_TPREL32;
1540enum R_PARISC_TLS_TPREL64 = R_PARISC_TPREL64;
1541enum R_PARISC_HIRESERVE = 255;
1542
1543enum PT_HP_TLS = (PT_LOOS + 0x0);
1544enum PT_HP_CORE_NONE = (PT_LOOS + 0x1);
1545enum PT_HP_CORE_VERSION = (PT_LOOS + 0x2);
1546enum PT_HP_CORE_KERNEL = (PT_LOOS + 0x3);
1547enum PT_HP_CORE_COMM = (PT_LOOS + 0x4);
1548enum PT_HP_CORE_PROC = (PT_LOOS + 0x5);
1549enum PT_HP_CORE_LOADABLE = (PT_LOOS + 0x6);
1550enum PT_HP_CORE_STACK = (PT_LOOS + 0x7);
1551enum PT_HP_CORE_SHM = (PT_LOOS + 0x8);
1552enum PT_HP_CORE_MMF = (PT_LOOS + 0x9);
1553enum PT_HP_PARALLEL = (PT_LOOS + 0x10);
1554enum PT_HP_FASTBIND = (PT_LOOS + 0x11);
1555enum PT_HP_OPT_ANNOT = (PT_LOOS + 0x12);
1556enum PT_HP_HSL_ANNOT = (PT_LOOS + 0x13);
1557enum PT_HP_STACK = (PT_LOOS + 0x14);
1558
1559enum PT_PARISC_ARCHEXT = 0x70000000;
1560enum PT_PARISC_UNWIND = 0x70000001;
1561
1562enum PF_PARISC_SBP = 0x08000000;
1563
1564enum PF_HP_PAGE_SIZE = 0x00100000;
1565enum PF_HP_FAR_SHARED = 0x00200000;
1566enum PF_HP_NEAR_SHARED = 0x00400000;
1567enum PF_HP_CODE = 0x01000000;
1568enum PF_HP_MODIFY = 0x02000000;
1569enum PF_HP_LAZYSWAP = 0x04000000;
1570enum PF_HP_SBP = 0x08000000;
1571
1572enum EF_ALPHA_32BIT = 1;
1573enum EF_ALPHA_CANRELAX = 2;
1574enum SHT_ALPHA_DEBUG = 0x70000001;
1575enum SHT_ALPHA_REGINFO = 0x70000002;
1576
1577enum SHF_ALPHA_GPREL = 0x10000000;
1578enum STO_ALPHA_NOPV = 0x80;
1579enum STO_ALPHA_STD_GPLOAD = 0x88;
1580
1581enum R_ALPHA_NONE = 0;
1582enum R_ALPHA_REFLONG = 1;
1583enum R_ALPHA_REFQUAD = 2;
1584enum R_ALPHA_GPREL32 = 3;
1585enum R_ALPHA_LITERAL = 4;
1586enum R_ALPHA_LITUSE = 5;
1587enum R_ALPHA_GPDISP = 6;
1588enum R_ALPHA_BRADDR = 7;
1589enum R_ALPHA_HINT = 8;
1590enum R_ALPHA_SREL16 = 9;
1591enum R_ALPHA_SREL32 = 10;
1592enum R_ALPHA_SREL64 = 11;
1593enum R_ALPHA_GPRELHIGH = 17;
1594enum R_ALPHA_GPRELLOW = 18;
1595enum R_ALPHA_GPREL16 = 19;
1596enum R_ALPHA_COPY = 24;
1597enum R_ALPHA_GLOB_DAT = 25;
1598enum R_ALPHA_JMP_SLOT = 26;
1599enum R_ALPHA_RELATIVE = 27;
1600enum R_ALPHA_TLS_GD_HI = 28;
1601enum R_ALPHA_TLSGD = 29;
1602enum R_ALPHA_TLS_LDM = 30;
1603enum R_ALPHA_DTPMOD64 = 31;
1604enum R_ALPHA_GOTDTPREL = 32;
1605enum R_ALPHA_DTPREL64 = 33;
1606enum R_ALPHA_DTPRELHI = 34;
1607enum R_ALPHA_DTPRELLO = 35;
1608enum R_ALPHA_DTPREL16 = 36;
1609enum R_ALPHA_GOTTPREL = 37;
1610enum R_ALPHA_TPREL64 = 38;
1611enum R_ALPHA_TPRELHI = 39;
1612enum R_ALPHA_TPRELLO = 40;
1613enum R_ALPHA_TPREL16 = 41;
1614enum R_ALPHA_NUM = 46;
1615enum LITUSE_ALPHA_ADDR = 0;
1616enum LITUSE_ALPHA_BASE = 1;
1617enum LITUSE_ALPHA_BYTOFF = 2;
1618enum LITUSE_ALPHA_JSR = 3;
1619enum LITUSE_ALPHA_TLS_GD = 4;
1620enum LITUSE_ALPHA_TLS_LDM = 5;
1621enum DT_ALPHA_PLTRO = (DT_LOPROC + 0);
1622enum DT_ALPHA_NUM = 1;
1623enum EF_PPC_EMB = 0x80000000;
1624enum EF_PPC_RELOCATABLE = 0x00010000;
1625enum EF_PPC_RELOCATABLE_LIB = 0x00008000;
1626enum R_PPC_NONE = 0;
1627enum R_PPC_ADDR32 = 1;
1628enum R_PPC_ADDR24 = 2;
1629enum R_PPC_ADDR16 = 3;
1630enum R_PPC_ADDR16_LO = 4;
1631enum R_PPC_ADDR16_HI = 5;
1632enum R_PPC_ADDR16_HA = 6;
1633enum R_PPC_ADDR14 = 7;
1634enum R_PPC_ADDR14_BRTAKEN = 8;
1635enum R_PPC_ADDR14_BRNTAKEN = 9;
1636enum R_PPC_REL24 = 10;
1637enum R_PPC_REL14 = 11;
1638enum R_PPC_REL14_BRTAKEN = 12;
1639enum R_PPC_REL14_BRNTAKEN = 13;
1640enum R_PPC_GOT16 = 14;
1641enum R_PPC_GOT16_LO = 15;
1642enum R_PPC_GOT16_HI = 16;
1643enum R_PPC_GOT16_HA = 17;
1644enum R_PPC_PLTREL24 = 18;
1645enum R_PPC_COPY = 19;
1646enum R_PPC_GLOB_DAT = 20;
1647enum R_PPC_JMP_SLOT = 21;
1648enum R_PPC_RELATIVE = 22;
1649enum R_PPC_LOCAL24PC = 23;
1650enum R_PPC_UADDR32 = 24;
1651enum R_PPC_UADDR16 = 25;
1652enum R_PPC_REL32 = 26;
1653enum R_PPC_PLT32 = 27;
1654enum R_PPC_PLTREL32 = 28;
1655enum R_PPC_PLT16_LO = 29;
1656enum R_PPC_PLT16_HI = 30;
1657enum R_PPC_PLT16_HA = 31;
1658enum R_PPC_SDAREL16 = 32;
1659enum R_PPC_SECTOFF = 33;
1660enum R_PPC_SECTOFF_LO = 34;
1661enum R_PPC_SECTOFF_HI = 35;
1662enum R_PPC_SECTOFF_HA = 36;
1663enum R_PPC_TLS = 67;
1664enum R_PPC_DTPMOD32 = 68;
1665enum R_PPC_TPREL16 = 69;
1666enum R_PPC_TPREL16_LO = 70;
1667enum R_PPC_TPREL16_HI = 71;
1668enum R_PPC_TPREL16_HA = 72;
1669enum R_PPC_TPREL32 = 73;
1670enum R_PPC_DTPREL16 = 74;
1671enum R_PPC_DTPREL16_LO = 75;
1672enum R_PPC_DTPREL16_HI = 76;
1673enum R_PPC_DTPREL16_HA = 77;
1674enum R_PPC_DTPREL32 = 78;
1675enum R_PPC_GOT_TLSGD16 = 79;
1676enum R_PPC_GOT_TLSGD16_LO = 80;
1677enum R_PPC_GOT_TLSGD16_HI = 81;
1678enum R_PPC_GOT_TLSGD16_HA = 82;
1679enum R_PPC_GOT_TLSLD16 = 83;
1680enum R_PPC_GOT_TLSLD16_LO = 84;
1681enum R_PPC_GOT_TLSLD16_HI = 85;
1682enum R_PPC_GOT_TLSLD16_HA = 86;
1683enum R_PPC_GOT_TPREL16 = 87;
1684enum R_PPC_GOT_TPREL16_LO = 88;
1685enum R_PPC_GOT_TPREL16_HI = 89;
1686enum R_PPC_GOT_TPREL16_HA = 90;
1687enum R_PPC_GOT_DTPREL16 = 91;
1688enum R_PPC_GOT_DTPREL16_LO = 92;
1689enum R_PPC_GOT_DTPREL16_HI = 93;
1690enum R_PPC_GOT_DTPREL16_HA = 94;
1691enum R_PPC_EMB_NADDR32 = 101;
1692enum R_PPC_EMB_NADDR16 = 102;
1693enum R_PPC_EMB_NADDR16_LO = 103;
1694enum R_PPC_EMB_NADDR16_HI = 104;
1695enum R_PPC_EMB_NADDR16_HA = 105;
1696enum R_PPC_EMB_SDAI16 = 106;
1697enum R_PPC_EMB_SDA2I16 = 107;
1698enum R_PPC_EMB_SDA2REL = 108;
1699enum R_PPC_EMB_SDA21 = 109;
1700enum R_PPC_EMB_MRKREF = 110;
1701enum R_PPC_EMB_RELSEC16 = 111;
1702enum R_PPC_EMB_RELST_LO = 112;
1703enum R_PPC_EMB_RELST_HI = 113;
1704enum R_PPC_EMB_RELST_HA = 114;
1705enum R_PPC_EMB_BIT_FLD = 115;
1706enum R_PPC_EMB_RELSDA = 116;
1707enum R_PPC_DIAB_SDA21_LO = 180;
1708enum R_PPC_DIAB_SDA21_HI = 181;
1709enum R_PPC_DIAB_SDA21_HA = 182;
1710enum R_PPC_DIAB_RELSDA_LO = 183;
1711enum R_PPC_DIAB_RELSDA_HI = 184;
1712enum R_PPC_DIAB_RELSDA_HA = 185;
1713enum R_PPC_IRELATIVE = 248;
1714enum R_PPC_REL16 = 249;
1715enum R_PPC_REL16_LO = 250;
1716enum R_PPC_REL16_HI = 251;
1717enum R_PPC_REL16_HA = 252;
1718enum R_PPC_TOC16 = 255;
1719enum DT_PPC_GOT = (DT_LOPROC + 0);
1720enum DT_PPC_NUM = 1;
1721enum R_PPC64_NONE = R_PPC_NONE;
1722enum R_PPC64_ADDR32 = R_PPC_ADDR32;
1723enum R_PPC64_ADDR24 = R_PPC_ADDR24;
1724enum R_PPC64_ADDR16 = R_PPC_ADDR16;
1725enum R_PPC64_ADDR16_LO = R_PPC_ADDR16_LO;
1726enum R_PPC64_ADDR16_HI = R_PPC_ADDR16_HI;
1727enum R_PPC64_ADDR16_HA = R_PPC_ADDR16_HA;
1728enum R_PPC64_ADDR14 = R_PPC_ADDR14;
1729enum R_PPC64_ADDR14_BRTAKEN = R_PPC_ADDR14_BRTAKEN;
1730enum R_PPC64_ADDR14_BRNTAKEN = R_PPC_ADDR14_BRNTAKEN;
1731enum R_PPC64_REL24 = R_PPC_REL24;
1732enum R_PPC64_REL14 = R_PPC_REL14;
1733enum R_PPC64_REL14_BRTAKEN = R_PPC_REL14_BRTAKEN;
1734enum R_PPC64_REL14_BRNTAKEN = R_PPC_REL14_BRNTAKEN;
1735enum R_PPC64_GOT16 = R_PPC_GOT16;
1736enum R_PPC64_GOT16_LO = R_PPC_GOT16_LO;
1737enum R_PPC64_GOT16_HI = R_PPC_GOT16_HI;
1738enum R_PPC64_GOT16_HA = R_PPC_GOT16_HA;
1739
1740enum R_PPC64_COPY = R_PPC_COPY;
1741enum R_PPC64_GLOB_DAT = R_PPC_GLOB_DAT;
1742enum R_PPC64_JMP_SLOT = R_PPC_JMP_SLOT;
1743enum R_PPC64_RELATIVE = R_PPC_RELATIVE;
1744
1745enum R_PPC64_UADDR32 = R_PPC_UADDR32;
1746enum R_PPC64_UADDR16 = R_PPC_UADDR16;
1747enum R_PPC64_REL32 = R_PPC_REL32;
1748enum R_PPC64_PLT32 = R_PPC_PLT32;
1749enum R_PPC64_PLTREL32 = R_PPC_PLTREL32;
1750enum R_PPC64_PLT16_LO = R_PPC_PLT16_LO;
1751enum R_PPC64_PLT16_HI = R_PPC_PLT16_HI;
1752enum R_PPC64_PLT16_HA = R_PPC_PLT16_HA;
1753
1754enum R_PPC64_SECTOFF = R_PPC_SECTOFF;
1755enum R_PPC64_SECTOFF_LO = R_PPC_SECTOFF_LO;
1756enum R_PPC64_SECTOFF_HI = R_PPC_SECTOFF_HI;
1757enum R_PPC64_SECTOFF_HA = R_PPC_SECTOFF_HA;
1758enum R_PPC64_ADDR30 = 37;
1759enum R_PPC64_ADDR64 = 38;
1760enum R_PPC64_ADDR16_HIGHER = 39;
1761enum R_PPC64_ADDR16_HIGHERA = 40;
1762enum R_PPC64_ADDR16_HIGHEST = 41;
1763enum R_PPC64_ADDR16_HIGHESTA = 42;
1764enum R_PPC64_UADDR64 = 43;
1765enum R_PPC64_REL64 = 44;
1766enum R_PPC64_PLT64 = 45;
1767enum R_PPC64_PLTREL64 = 46;
1768enum R_PPC64_TOC16 = 47;
1769enum R_PPC64_TOC16_LO = 48;
1770enum R_PPC64_TOC16_HI = 49;
1771enum R_PPC64_TOC16_HA = 50;
1772enum R_PPC64_TOC = 51;
1773enum R_PPC64_PLTGOT16 = 52;
1774enum R_PPC64_PLTGOT16_LO = 53;
1775enum R_PPC64_PLTGOT16_HI = 54;
1776enum R_PPC64_PLTGOT16_HA = 55;