2011-06-18 23:48:42 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <elf.h>
|
|
|
|
|
2013-07-18 23:29:44 +00:00
|
|
|
#define LDSO_ARCH "x86_64"
|
2011-06-25 05:56:34 +00:00
|
|
|
|
2014-06-18 06:44:02 +00:00
|
|
|
static int remap_rel(int type)
|
2011-06-18 23:48:42 +00:00
|
|
|
{
|
|
|
|
switch(type) {
|
|
|
|
case R_X86_64_64:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_SYMBOLIC;
|
2011-06-18 23:48:42 +00:00
|
|
|
case R_X86_64_PC32:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_OFFSET32;
|
|
|
|
case R_X86_64_GLOB_DAT:
|
|
|
|
return REL_GOT;
|
|
|
|
case R_X86_64_JUMP_SLOT:
|
|
|
|
return REL_PLT;
|
2011-06-18 23:48:42 +00:00
|
|
|
case R_X86_64_RELATIVE:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_RELATIVE;
|
2011-06-18 23:48:42 +00:00
|
|
|
case R_X86_64_COPY:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_COPY;
|
2012-10-05 05:00:40 +00:00
|
|
|
case R_X86_64_DTPMOD64:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_DTPMOD;
|
2012-10-05 05:00:40 +00:00
|
|
|
case R_X86_64_DTPOFF64:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_DTPOFF;
|
2012-10-05 05:00:40 +00:00
|
|
|
case R_X86_64_TPOFF64:
|
2014-06-18 06:44:02 +00:00
|
|
|
return REL_TPOFF;
|
2011-06-18 23:48:42 +00:00
|
|
|
}
|
2014-06-16 07:09:07 +00:00
|
|
|
return 0;
|
2011-06-18 23:48:42 +00:00
|
|
|
}
|