Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519678

Re: [PATCH] um: Fix compile failure due to current_text_address() definition

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: [PATCH] um: Fix compile failure due to current_text_address() definition
Date 2016-11-11 11:40 +0100
Message-ID <sChpw-392-27@gated-at.bofh.it> (permalink)
References <sBMOJ-7gR-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Keno,

On 10.11.2016 02:53, Keno Fischer wrote:
> 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
> ```

How and where do you trigger this?
I had a chat with Sebastian and we are not 100% sure what is going on.
On my freshly installed Debian sid with gcc version 6.2.0 20161109 (Debian 6.2.0-13)
UML builds fine except when I set CONFIG_STATIC_LINK=y

But then I'm facing a slightly different error:
  CC      init/version.o
  LD      init/built-in.o
/usr/bin/ld: init/built-in.o: relocation R_X86_64_PLTOFF64 against STT_GNU_IFUNC symbol `memmove' isn't supported
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Your patch also does not cure this. I'll investigate later into that.

> 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; })

Thanks,
//richard

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] um: Fix compile failure due to current_text_address()  definition Keno Fischer <keno@juliacomputing.com> - 2016-11-10 03:00 +0100
  Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-10 09:10 +0100
    Re: [PATCH] um: Fix compile failure due to current_text_address() definition Keno Fischer <keno@juliacomputing.com> - 2016-11-10 21:20 +0100
      Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-10 21:20 +0100
        Re: [PATCH] um: Fix compile failure due to current_text_address() definition Keno Fischer <keno@juliacomputing.com> - 2016-11-10 21:20 +0100
          Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-10 21:20 +0100
            Re: [PATCH] um: Fix compile failure due to current_text_address() definition Keno Fischer <keno@juliacomputing.com> - 2016-11-10 21:50 +0100
  Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-11 11:40 +0100
    Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-11 23:10 +0100
      Re: [PATCH] um: Fix compile failure due to current_text_address() definition Keno Fischer <keno@juliacomputing.com> - 2016-11-16 04:50 +0100
        Re: [PATCH] um: Fix compile failure due to current_text_address()  definition Richard Weinberger <richard@nod.at> - 2016-11-16 15:40 +0100

csiph-web