From c0017f91c4895e8cc625614454d0e2571c077770 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 7 Mar 2019 00:53:41 +0000 Subject: [PATCH] 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 --- gcc/go/ChangeLog | 6 ++++++ gcc/go/go-gcc.cc | 1 + 2 files changed, 7 insertions(+) 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; } -- 2.30.2