linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keno Fischer <keno@juliacomputing.com>
To: linux-kernel@vger.kernel.org
Cc: jdike@addtoit.com, richard@nod.at,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [PATCH] um: Fix compile failure due to current_text_address() definition
Date: Wed, 9 Nov 2016 20:53:26 -0500	[thread overview]
Message-ID: <20161110015326.GA51351@juliacomputing.com> (raw)

Fixes the following link error:
```
/usr/bin/ld: net/built-in.o: relocation R_X86_64_32S against `.text'
can not be used when making a shared object; recompile with -fPIC
```

This is the same definition used on some other architectures.

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
---
I am not sure this is the correct patch in the context of uml. I believe this
should give the runtime ip, which may be different between runs. It may be
better to use the offset in .text (e.g. by using `pc-__text_start`), which
should be consistent.

 arch/x86/um/asm/processor_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/um/asm/processor_64.h b/arch/x86/um/asm/processor_64.h
index c3be852..6ca3304 100644
--- a/arch/x86/um/asm/processor_64.h
+++ b/arch/x86/um/asm/processor_64.h
@@ -32,7 +32,7 @@ static inline void arch_copy_thread(struct arch_thread *from,
 }
 
 #define current_text_addr() \
-	({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
+	({ __label__ _l; _l: &&_l; })
 
 #define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; })
 #define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; })
-- 
2.9.3



             reply	other threads:[~2016-11-10  1:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10  1:53 Keno Fischer [this message]
2016-11-10  8:05 ` [uml-devel] [PATCH] um: Fix compile failure due to current_text_address() definition Richard Weinberger
2016-11-10 20:10   ` Keno Fischer
2016-11-10 20:14     ` Richard Weinberger
2016-11-10 20:14       ` Keno Fischer
2016-11-10 20:19         ` Richard Weinberger
2016-11-10 20:46           ` Keno Fischer
2016-11-11 10:34 ` [uml-devel] " Richard Weinberger
2016-11-11 21:03   ` Keno Fischer
2016-11-11 22:07     ` Richard Weinberger
2016-11-16  3:45       ` Keno Fischer
2016-11-16 14:36         ` [uml-devel] " Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161110015326.GA51351@juliacomputing.com \
    --to=keno@juliacomputing.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).