From: Ian Lance Taylor Date: Thu, 7 Mar 2019 00:53:41 +0000 (+0000) Subject: re PR go/89227 (gotools test cmd/go fails with link error "call lacks nop, can't... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0017f91c4895e8cc625614454d0e2571c077770;p=gcc.git re PR go/89227 (gotools test cmd/go fails with link error "call lacks nop, can't restore toc; recompile with -fPIC") PR go/89227 * go-gcc.cc (Gcc_backend::function): Set TREE_PUBLIC for an only-inline function. From-SVN: r269449 --- diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index e1efc14359c..2c88593b05b 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2019-03-06 Ian Lance Taylor + + PR go/89227 + * go-gcc.cc (Gcc_backend::function): Set TREE_PUBLIC for an + only-inline function. + 2019-02-15 Cherry Zhang * go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_dwarf_cfa diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index daa1ab2af49..1a52d9b22c1 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -3101,6 +3101,7 @@ Gcc_backend::function(Btype* fntype, const std::string& name, resolve_unique_section(decl, 0, 1); if ((flags & function_only_inline) != 0) { + TREE_PUBLIC (decl) = 1; DECL_EXTERNAL(decl) = 1; DECL_DECLARED_INLINE_P(decl) = 1; }