On 12/16/19 6:20 PM, Jason Merrill wrote:
On 11/29/19 6:23 PM, Strager Neds wrote:
How can we solve this problem? Some ideas (none of which I like):
* Disallow this code, possibly with an improved diagnostic.
* Silently make the section SECTION_LINKONCE if there is a conflict.
* Silently make
On 11/29/19 6:23 PM, Strager Neds wrote:
I discovered an issue with my patch. I need help resolving it.
Take the following code for example:
template
struct s
{
static inline int __attribute__((section(".testsection"))) var = 1;
};
struct public_symbol {};
I discovered an issue with my patch. I need help resolving it.
Take the following code for example:
template
struct s
{
static inline int __attribute__((section(".testsection"))) var = 1;
};
struct public_symbol {};
namespace {
struct internal_symbol {};
}
Here's a revised version of the patch. This revised version is ready for review.
When GCC encounters __attribute__((section("foo"))) on a function or
variable declaration, it adds an entry in the symbol table for the
declaration to remember its desired section. The symbol table is
separate from th
Summary: Do not merge my patch. It needs more work.
I realized a problem with my patch. With -flto,
__attribute__((section)) is still broken (i.e. my patch has no effect
for LTO builds). I narrowed the problem to localize_node
(gcc/ipa-visibility.c, historically part of
function_and_variable_visib
Aside: This is my first time working in GCC's code base. I probably made
some mistakes. Please point them out. =]
When GCC encounters __attribute__((section("foo"))) on a function or
variable declaration, it adds an entry in the symbol table for the
declaration to remember its desired section. The