compiler: make sure type descriptor initializers go in .rodata
authorIan Lance Taylor <ian@gcc.gnu.org>
Sun, 9 Sep 2018 13:26:17 +0000 (13:26 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sun, 9 Sep 2018 13:26:17 +0000 (13:26 +0000)
commitb8106e8fd7e7bf20b5f1b5a842931a51fc6dbdfa
treed86d734cb4c7d27b3d328f32d6c58a8e73202e07
parent04dad37c39e77274ff30873e2c8a205c764df5ce
compiler: make sure type descriptor initializers go in .rodata

    When creating type descriptor variables, the compiler (specifically
    Type::make_type_descriptor_var) invokes the immutable_struct() and
    immutable_struct_set_init() back end methods, so as to insure that
    these items go into the ".rodata" section of the generate object file.
    The expression initializers for these variables can contain nested
    subexpressions, however, and these subexpressions were not always
    being placed into .rodata. This patch changes the backend-gen code for
    slice initializers to emit implicit variables into .rodata if those
    initializers are part of a type descriptor init.

    Reviewed-on: https://go-review.googlesource.com/132596

From-SVN: r264181
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc