@@ -313,9 +313,10 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **list_p,
313313 reloc_data -> sym_value = h -> root .u .def .value ;
314314 reloc_data -> sym_section = h -> root .u .def .section ;
315315
316- sym_value = h -> root .u .def .value
317- + h -> root .u .def .section -> output_section -> vma
318- + h -> root .u .def .section -> output_offset ;
316+ if (h -> root .u .def .section -> output_section != NULL )
317+ sym_value = h -> root .u .def .value
318+ + h -> root .u .def .section -> output_section -> vma
319+ + h -> root .u .def .section -> output_offset ;
319320
320321 tls_sec = elf_hash_table (info )-> tls_sec ;
321322
@@ -408,10 +409,6 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **list_p,
408409
409410 case GOT_NORMAL :
410411 {
411- bfd_vma sec_vma
412- = reloc_data -> sym_section -> output_section -> vma
413- + reloc_data -> sym_section -> output_offset ;
414-
415412 if (h != NULL
416413 && h -> root .type == bfd_link_hash_undefweak )
417414 ARC_DEBUG ("arc_info: PATCHED: NOT_PATCHED "
@@ -424,6 +421,10 @@ relocate_fix_got_relocs_for_got_info (struct got_entry **list_p,
424421 (long ) entry -> offset );
425422 else
426423 {
424+ bfd_vma sec_vma
425+ = reloc_data -> sym_section -> output_section -> vma
426+ + reloc_data -> sym_section -> output_offset ;
427+
427428 write_in_got (output_bfd ,
428429 reloc_data -> sym_value + sec_vma ,
429430 htab -> sgot -> contents + entry -> offset );
0 commit comments