diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-07-28 18:59:08 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-07-31 12:50:54 +0200 |
commit | ae01de4d1d1e16e46c5180ba7fb081792081996a (patch) | |
tree | f5bbf5e332cc6b54a8d4f25321b7a273684fb8c8 | |
parent | d1bf524bae265e54d7695019d23e7416507bbe24 (diff) |
ARC: Support R_ARC_JMP_SLOT relocations during bootstrap
This commit adds support for R_ARC_JMP_SLOT relocations during the
bootstrap phase of the dynamic linker. These relocations will be
generated if uClibc-ng is configured with 'DODEBUG=y'.
-rw-r--r-- | ldso/ldso/arc/dl-startup.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ldso/ldso/arc/dl-startup.h b/ldso/ldso/arc/dl-startup.h index ef89b5317..fadc4330d 100644 --- a/ldso/ldso/arc/dl-startup.h +++ b/ldso/ldso/arc/dl-startup.h @@ -64,10 +64,11 @@ __asm__( /* * Dynamic loader bootstrapping: - * Since we don't modify text at runtime, these can only be data relos - * (so safe to assume that they are word aligned). - * And also they HAVE to be RELATIVE relos only - * @RELP is the relo entry being processed + * The only relocations that should be found are either R_ARC_RELATIVE for + * data relocations (.got, etc) or R_ARC_JMP_SLOT for code relocations + * (.plt). It is safe to assume that all of these relocations are word + * aligned. + * @RELP is the reloc entry being processed * @REL is the pointer to the address we are relocating. * @SYMBOL is the symbol involved in the relocation * @LOAD is the load address. @@ -78,6 +79,8 @@ do { \ int type = ELF32_R_TYPE((RELP)->r_info); \ if (likely(type == R_ARC_RELATIVE)) \ *REL += (unsigned long) LOAD; \ + else if (type == R_ARC_JMP_SLOT) \ + *REL = SYMBOL; \ else \ _dl_exit(1); \ }while(0) |