This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

elf-machine-dynamic for m68k


Hi,
  I am trying to understand dl-machine.h file for m68k.  I have few questions, it will be great if you can answer them. 
There are two functions in dl-machine.h file which i am more interested to understand. 

1. elf_machine_dynamic function 
/* Return the link-time address of _DYNAMIC.  Conveniently, this is the
   first element of the GOT.  This must be inlined in a function which
   uses global data.  */
elf_machine_dynamic (void)
{
  register Elf32_Addr *got asm ("%a5");
  return *got;
}

2. elf_machine_load_address
static inline Elf32_Addr
elf_machine_load_address (void)
{
  Elf32_Addr addr;
  asm ("lea _dl_start(%%pc), %0\n\t"
       "sub.l _dl_start@GOT.w(%%a5), %0"
       : "=a" (addr));
  return addr;
}
These functions are using a5 but I am unable to understand where a5 is initialized. I am confused because elf_machine_dynamic function says Return the link-time address of _DYNAMIC that means a5 holds _DYNAMIC, but when a code is compiled with -fPIC a5 holds GLOBAL_OFFSET_TABLE!!

> -----Original Message-----
> From: Andreas Schwab [mailto:schwab@suse.de]
> Sent: Saturday, July 24, 2004 5:52 PM
> To: C Jaiprakash, Noida
> Subject: Re: GLIBC port for Coldfire V4e
> 
> 
> "C Jaiprakash, Noida" <C.Jaiprakash@noida.hcltech.com> writes:
> 
> > Hi,
> >   I have almost done with coldfire v4e port, i could 
> compile glibc with
> >   shared libraries support but with -O1 option. There are 
> few problems
> >   with -O2 option. I had one doubt though .. do i have to provide
> >   tls-macros in elf/ ?  Compiler(GCC) for m68k/coldfire 
> though does not
> >   have TLS support. I could not get much documentation for 
> these macros
> >   but.
> 
> If you don't have TLS then you don't need any tls macros, obviously.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
> Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 


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