diff options
author | Alan Modra <amodra@gmail.com> | 2014-05-15 18:37:43 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-05-15 18:37:43 +0930 |
commit | 5fe7ffdc98b769de3ea67e6f38bc5de57be7b265 (patch) | |
tree | 3dcc4e843b84a1fb9749dfab2fab4eead4505387 /gold/powerpc.cc | |
parent | 57b287416bcd3dd29202dff55d89dc7a68196cc8 (diff) | |
download | gdb-5fe7ffdc98b769de3ea67e6f38bc5de57be7b265.zip gdb-5fe7ffdc98b769de3ea67e6f38bc5de57be7b265.tar.gz gdb-5fe7ffdc98b769de3ea67e6f38bc5de57be7b265.tar.bz2 |
Fix "overflow in PLT unwind data" warning
When linking statically, it's possible to hit this warning with IFUNC
or very large executables, due to .glink being unused.
* powerpc.cc (do_plt_fde_location): Handle zero length .glink.
Compare FDE contents with DW_CFA_nop rather than 0.
Diffstat (limited to 'gold/powerpc.cc')
-rw-r--r-- | gold/powerpc.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc index b9ee86e..e59c319 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -2851,7 +2851,21 @@ Target_powerpc<size, big_endian>::do_plt_fde_location(const Output_data* plt, if (plt == this->glink_) { // See Output_data_glink::do_write() for glink contents. - if (size == 64) + if (len == 0) + { + gold_assert(parameters->doing_static_link()); + // Static linking may need stubs, to support ifunc and long + // branches. We need to create an output section for + // .eh_frame early in the link process, to have a place to + // attach stub .eh_frame info. We also need to have + // registered a CIE that matches the stub CIE. Both of + // these requirements are satisfied by creating an FDE and + // CIE for .glink, even though static linking will leave + // .glink zero length. + // ??? Hopefully generating an FDE with a zero address range + // won't confuse anything that consumes .eh_frame info. + } + else if (size == 64) { // There is one word before __glink_PLTresolve address += 8; @@ -2863,7 +2877,7 @@ Target_powerpc<size, big_endian>::do_plt_fde_location(const Output_data* plt, // The first covers the branch table, the second // __glink_PLTresolve at the end of glink. off_t resolve_size = this->glink_->pltresolve_size; - if (oview[9] == 0) + if (oview[9] == elfcpp::DW_CFA_nop) len -= resolve_size; else { |