This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: absolute syms in shared libs


Daniel Jacobowitz <drow@mvista.com> writes:

> On Fri, Oct 04, 2002 at 11:34:37AM +0930, Alan Modra wrote:
>> Oops, our "jmp foo" goes to the shared lib load address + 0x12345678.
>> 
>> This can be fixed, but I'm just wondering whether it's wise to
>> change the current ld behaviour.  Opinions?
>
> Well, from your description I believe that a 'jmp foo' in one of the
> shared libraries would go to a different place than a 'jmp foo' in the
> other.  So I'd say that either:
>   - we pick one of those consistently
>   - we issue an error for an absolute symbol in a shared library

But sometimes shared symbols might be needed in a shared library.  On
Linux/x86-64 we use virtual syscalls which are implemented from the
user side with a jump into an absolute address:

#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000


ENTRY (__gettimeofday)
	/* Align stack.  */
	sub	$0x8, %rsp
	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
	callq	*%rax

Ok, my implementation does not use an absolute address but instead a
constant but it might be possible to rewrite this using an absolute
address - and we might want to support this.

Or did I misunderstood the original problem?

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]