forked from OSchip/llvm-project
Added a "ArchSpec::SetElfArch()" that was removed by a previous patch and
avoid using RTLD_FIRST with dlopen to keep things compatible with other *NIX variants. Patch from Jai Menon. llvm-svn: 125015
This commit is contained in:
parent
06fce87c4a
commit
75852f56ae
|
@ -269,6 +269,14 @@ public:
|
|||
m_sub = sub;
|
||||
}
|
||||
|
||||
void
|
||||
SetElfArch (uint32_t cpu, uint32_t sub)
|
||||
{
|
||||
m_type = lldb::eArchTypeELF;
|
||||
m_cpu = cpu;
|
||||
m_sub = sub;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Returns the default endianness of the architecture.
|
||||
///
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <libproc.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <sys/sysctl.h>
|
||||
#elif defined (__linux__)
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
using namespace lldb;
|
||||
|
@ -243,7 +245,7 @@ Host::GetArchitecture ()
|
|||
}
|
||||
}
|
||||
#elif defined (__linux__)
|
||||
g_host_arch.SetArch(7u, 144u);
|
||||
g_host_arch.SetElfArch(7u, 144u);
|
||||
#endif
|
||||
}
|
||||
return g_host_arch;
|
||||
|
@ -648,7 +650,11 @@ Host::DynamicLibraryOpen (const FileSpec &file_spec, Error &error)
|
|||
char path[PATH_MAX];
|
||||
if (file_spec.GetPath(path, sizeof(path)))
|
||||
{
|
||||
#if defined (__linux__)
|
||||
dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL);
|
||||
#else
|
||||
dynamic_library_handle = ::dlopen (path, RTLD_LAZY | RTLD_GLOBAL | RTLD_FIRST);
|
||||
#endif
|
||||
if (dynamic_library_handle)
|
||||
{
|
||||
error.Clear();
|
||||
|
|
Loading…
Reference in New Issue