[1/2] ARC: Update relocation syntax for old-thread model code

Submitted by Andrew Burgess on July 28, 2016, 6:20 p.m.


Message ID 1469730034-8068-2-git-send-email-andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess July 28, 2016, 6:20 p.m.
This commit reverses a change introduced in commit 20554a78a9bba that
split some of the ARC code into two based on whether uClibc was
configured with native threads or not.

The native thread code was updated to use the relocation syntax of
modern binutils, while the non-native code path used a syntax only
accepted in older versions of binutils.

The problem with this is that the choice of old binutils or not is
orthogonal to the choice of native threads or not, and so, inevitably a
user with a recent version of binutils can make the choice to configure
uClibc with non-native thread support, and run into code that will not

The solution is either to abandon support for the old tools completely,
or to add a new compile time flag for ARC that is set when the version
of binutils being used is old; this new flag would allow the old
relocation structure to be selected.

In this commit I have simply dropped support for older versions of the
 ldso/ldso/arc/dl-startup.h | 7 -------
 ldso/ldso/arc/dl-sysdep.h  | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/ldso/ldso/arc/dl-startup.h b/ldso/ldso/arc/dl-startup.h
index ef89b53..664b860 100644
--- a/ldso/ldso/arc/dl-startup.h
+++ b/ldso/ldso/arc/dl-startup.h
@@ -34,15 +34,8 @@  __asm__(
     "   ; skip the extra args calc by dl_start()                \n"
     "   ld_s    r1, [sp]       ; orig argc from aux-vec Tbl     \n"
     "   ld      r12, [pcl, _dl_skip_args@pcl]                   \n"
     "   add     r2, pcl, _dl_fini@pcl       ; finalizer         \n"
-    "   add     r12, pcl, _dl_skip_args-.+(.&2)                 \n"
-    "   ld      r12, [r12]                                      \n"
-    "   add     r2, pcl, _dl_fini-.+(.&2)   ; finalizer         \n"
     "   add2    sp, sp, r12    ; discard argv entries from stack\n"
     "   sub_s   r1, r1, r12    ; adjusted argc, on stack        \n"
diff --git a/ldso/ldso/arc/dl-sysdep.h b/ldso/ldso/arc/dl-sysdep.h
index caece99..aadf624 100644
--- a/ldso/ldso/arc/dl-sysdep.h
+++ b/ldso/ldso/arc/dl-sysdep.h
@@ -154,7 +154,7 @@  static __always_inline Elf32_Addr elf_machine_load_address(void)
 	Elf32_Addr addr, tmp;
 	__asm__ (
         "ld  %1, [pcl, _dl_start@gotpc] ;build addr of _dl_start   \n"
-        "add %0, pcl, _dl_start-.+(.&2) ;runtime addr of _dl_start \n"
+        "add %0, pcl, _dl_start@pcl     ;runtime addr of _dl_start \n"
         "sub %0, %0, %1                 ;delta                     \n"
          : "=&r" (addr), "=r"(tmp)