Permalink
Browse files

3263 link.h should work in a largefile environment

Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
  • Loading branch information...
1 parent 965630c commit 4d1bea1d3d1629ed6f2d64053795d583ad948808 @richlowe richlowe committed Oct 7, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 usr/src/head/link.h
View
@@ -28,7 +28,7 @@
#include <sys/link.h>
#ifndef _ASM
-#include <libelf.h>
+#include <elf.h>
#include <sys/types.h>
#include <dlfcn.h>
#endif
@@ -39,9 +39,15 @@ extern "C" {
#ifndef _ASM
/*
- * ld support library calls
+ * ld support library calls.
+ *
+ * These cannot be used in a 32bit large file capable environment because
+ * libelf is not large-file safe. Only define these interfaces if we are not
+ * 32bit, or not in the large file environment.
*/
+#if !defined(_ILP32) || _FILE_OFFSET_BITS != 64
#ifdef __STDC__
+#include <libelf.h>
extern uint_t ld_version(uint_t);
extern void ld_input_done(uint_t *);
@@ -88,6 +94,7 @@ extern void ld_section64();
#endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif /* __STDC__ */
+#endif /* !defined(_ILP32) || _FILE_OFFSET_BITS != 64 */
/*
* ld_version() version values.

0 comments on commit 4d1bea1

Please sign in to comment.