NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-macppc/47464: cannot run older programs (around 2005/2006 time frame) due to undefined symbols _SDA_BASE_ and _SDA2_BASE_



The following reply was made to PR port-macppc/47464; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-macppc/47464: cannot run older programs (around 2005/2006
 time frame) due to undefined symbols _SDA_BASE_ and _SDA2_BASE_
Date: Wed, 26 Apr 2017 11:29:47 +0300

 On Tue, Apr 25, 2017 at 21:01:57 +0300, Valery Ushakov wrote:
 
 > I'm not sure what a good fix for this would be.  May be a ppc-specific
 > hack in ld.so that detects bogus COPY relocs for _SDA_BASE_ and treats
 > them specially?
 
 Looking at it a bit closer...  _SDA_BASE_ has zero size so a COPY
 reloc for it is a no-op anyway.
 
 
 --- reloc.c.~1.109.~	2016-08-29 20:26:41.000000000 +0300
 +++ reloc.c	2017-04-26 11:10:07.643925379 +0300
 @@ -73,6 +73,16 @@ _rtld_do_copy_relocation(const Obj_Entry
  	const Elf_Sym  *srcsym = NULL;
  	Obj_Entry      *srcobj;
  
 +#if defined(__powerpc__) && !defined(__LP64)
 +	if (strcmp(name, "_SDA_BASE_") == 0
 +	    || strcmp(name, "_SDA2_BASE_") == 0)
 +	{
 +	    rdbg(("COPY %s %s --> old bug, ignored\n",
 +		  dstobj->path, name));
 +	    return 0;
 +	}
 +#endif
 +
  	for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) {
  		srcsym = _rtld_symlook_obj(name, hash, srcobj, 0,
  		    _rtld_fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)));
 
 
 -uwe
 


Home | Main Index | Thread Index | Old Index