@ -1972,8 +1972,6 @@ static boolean ppc64_elf_adjust_dynamic_symbol
PARAMS ( ( struct bfd_link_info * , struct elf_link_hash_entry * ) ) ;
static void ppc64_elf_hide_symbol
PARAMS ( ( struct bfd_link_info * , struct elf_link_hash_entry * , boolean ) ) ;
static boolean edit_opd
PARAMS ( ( bfd * , struct bfd_link_info * ) ) ;
static boolean allocate_dynrelocs
PARAMS ( ( struct elf_link_hash_entry * , PTR ) ) ;
static boolean readonly_dynrelocs
@ -3539,8 +3537,8 @@ ppc64_elf_hide_symbol (info, h, force_local)
}
}
static boolean
edit_opd ( obfd , info )
boolean
ppc64_elf_ edit_opd ( obfd , info )
bfd * obfd ;
struct bfd_link_info * info ;
{
@ -3557,6 +3555,7 @@ edit_opd (obfd, info)
Elf_Internal_Sym * local_syms ;
struct elf_link_hash_entry * * sym_hashes ;
bfd_vma offset ;
bfd_size_type amt ;
long * adjust ;
boolean need_edit ;
@ -3564,9 +3563,16 @@ edit_opd (obfd, info)
if ( sec = = NULL )
continue ;
amt = sec - > _raw_size * sizeof ( long ) / 24 ;
adjust = ( long * ) elf_section_data ( sec ) - > tdata ;
BFD_ASSERT ( adjust ! = NULL ) ;
memset ( adjust , 0 , ( size_t ) sec - > _raw_size * sizeof ( long ) / 24 ) ;
if ( adjust = = NULL )
{
/* Must be a ld -r link. ie. check_relocs hasn't been
called . */
adjust = ( long * ) bfd_zalloc ( obfd , amt ) ;
elf_section_data ( sec ) - > tdata = adjust ;
}
memset ( adjust , 0 , ( size_t ) amt ) ;
if ( sec - > output_section = = bfd_abs_section_ptr )
continue ;
@ -3769,14 +3775,29 @@ edit_opd (obfd, info)
{
/* Arrange for the function descriptor sym
to be dropped . */
struct elf _link_hash_entry * fdh ;
struct ppc _link_hash_entry * fdh ;
struct ppc_link_hash_entry * fh ;
fh = ( struct ppc_link_hash_entry * ) h ;
BFD_ASSERT ( fh - > is_func ) ;
fdh = fh - > oh ;
fdh - > root . u . def . value = 0 ;
fdh - > root . u . def . section = sym_sec ;
fdh = ( struct ppc_link_hash_entry * ) fh - > oh ;
if ( fdh = = NULL )
{
const char * fd_name ;
struct ppc_link_hash_table * htab ;
fd_name = h - > root . root . string + 1 ;
htab = ppc_hash_table ( info ) ;
fdh = ( struct ppc_link_hash_entry * )
elf_link_hash_lookup ( & htab - > elf , fd_name ,
false , false , false ) ;
fdh - > is_func_descriptor = 1 ;
fdh - > oh = & fh - > elf ;
fh - > is_func = 1 ;
fh - > oh = & fdh - > elf ;
}
fdh - > elf . root . u . def . value = 0 ;
fdh - > elf . root . u . def . section = sym_sec ;
}
}
else
@ -3789,13 +3810,28 @@ edit_opd (obfd, info)
to this location in the opd section .
We ' ve checked above that opd relocs are
ordered . */
struct elf _link_hash_entry * fdh ;
struct ppc _link_hash_entry * fdh ;
struct ppc_link_hash_entry * fh ;
fh = ( struct ppc_link_hash_entry * ) h ;
BFD_ASSERT ( fh - > is_func ) ;
fdh = fh - > oh ;
fdh - > root . u . def . value = wptr - sec - > contents ;
fdh = ( struct ppc_link_hash_entry * ) fh - > oh ;
if ( fdh = = NULL )
{
const char * fd_name ;
struct ppc_link_hash_table * htab ;
fd_name = h - > root . root . string + 1 ;
htab = ppc_hash_table ( info ) ;
fdh = ( struct ppc_link_hash_entry * )
elf_link_hash_lookup ( & htab - > elf , fd_name ,
false , false , false ) ;
fdh - > is_func_descriptor = 1 ;
fdh - > oh = & fh - > elf ;
fh - > is_func = 1 ;
fh - > oh = & fdh - > elf ;
}
fdh - > elf . root . u . def . value = wptr - sec - > contents ;
}
else
{
@ -4145,9 +4181,6 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
}
}
if ( ! edit_opd ( output_bfd , info ) )
return false ;
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs . */
elf_link_hash_traverse ( & htab - > elf , allocate_dynrelocs , ( PTR ) info ) ;