[RS6000] ABI_V4 init of toc section
commit90c8d97130f9e3d4ffe2a0c26bbc1b51124cd238
authorAlan Modra <amodra@gmail.com>
Tue, 2 Feb 2016 00:01:16 +0000 (2 10:31 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Tue, 2 Feb 2016 00:01:16 +0000 (2 10:31 +1030)
tree7b160fbbcebddbd11d9eae06696812fc688db6e0
parentd0268b37f87359ebf5d6f8bd95fe9829b520749a
[RS6000] ABI_V4 init of toc section

Since 4c4a180d lto has turned off flag_pic when linking a fixed
position executable.  So flag_pic is zero in rs6000_file_start.
However, when we get to actually emitting code, flag_pic may be on
again.  This results in undefined references to ".LCTOC1".

PR target/68662
* config/rs6000/rs6000.c (need_toc_init): New var, set it
whenever toc_label_name used.
(rs6000_file_start): Don't set up toc section here,
(rs6000_output_function_epilogue): do so here instead,
(rs6000_xcoff_file_start): and here.
* config/rs6000/rs6000.md (load_toc_aix_si): Set need_toc_init.
(load_toc_aix_di): Likewise.

From-SVN: r233061
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md