diff options
author | Ian Lance Taylor <iant@google.com> | 2008-02-12 00:28:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2008-02-12 00:28:48 +0000 |
commit | dceae3c154edcb9aada9f94452a72548a82914f5 (patch) | |
tree | b9fb771a92a28b7047bdea1b9e2104e8d6b82f73 /gold/i386.cc | |
parent | 709d67f15ab46ff1d18da0e2c2c7dcea140155a5 (diff) | |
download | gdb-dceae3c154edcb9aada9f94452a72548a82914f5.zip gdb-dceae3c154edcb9aada9f94452a72548a82914f5.tar.gz gdb-dceae3c154edcb9aada9f94452a72548a82914f5.tar.bz2 |
Support dynamic relocations against local section symbols.
Diffstat (limited to 'gold/i386.cc')
-rw-r--r-- | gold/i386.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gold/i386.cc b/gold/i386.cc index d6e42f4..2d8efdd 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -898,9 +898,19 @@ Target_i386::Scan::local(const General_options&, if (parameters->output_is_position_independent()) { Reloc_section* rel_dyn = target->rel_dyn_section(layout); - unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info()); - rel_dyn->add_local(object, r_sym, r_type, output_section, data_shndx, - reloc.get_r_offset()); + if (lsym.get_st_type() != elfcpp::STT_SECTION) + { + unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info()); + rel_dyn->add_local(object, r_sym, r_type, output_section, + data_shndx, reloc.get_r_offset()); + } + else + { + gold_assert(lsym.get_st_value() == 0); + rel_dyn->add_local_section(object, lsym.get_st_shndx(), + r_type, output_section, + data_shndx, reloc.get_r_offset()); + } } break; @@ -1053,6 +1063,7 @@ Target_i386::Scan::local(const General_options&, if (output_is_shared) { // We need to create a dynamic relocation. + gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION); unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info()); unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_LE_32 ? elfcpp::R_386_TLS_TPOFF32 |