Backported from mainline
2019-06-12 Jakub Jelinek <jakub@redhat.com>
PR c/90760
* symtab.c (symtab_node::set_section): Allow being called on aliases
as long as they aren't analyzed yet.
* gcc.dg/pr90760.c: New test.
From-SVN: r275159
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/90760
+ * symtab.c (symtab_node::set_section): Allow being called on aliases
+ as long as they aren't analyzed yet.
+
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/90139
void
symtab_node::set_section (const char *section)
{
- gcc_assert (!this->alias);
+ gcc_assert (!this->alias || !this->analyzed);
call_for_symbol_and_aliases
(symtab_node::set_section, const_cast<char *>(section), true);
}
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/90760
+ * gcc.dg/pr90760.c: New test.
+
2019-05-10 Jakub Jelinek <jakub@redhat.com>
PR pch/90326
--- /dev/null
+/* PR c/90760 */
+/* { dg-do compile } */
+/* { dg-require-named-sections "" } */
+
+void bar (void) {}
+void foo (void) __attribute__ ((alias ("bar"))); /* { dg-error "section of alias 'foo' must match section of its target" } */
+void foo (void) __attribute__ ((section ("baz")));
+void qux (void) __attribute__ ((alias ("bar"), section ("baz"))); /* { dg-error "section of alias 'qux' must match section of its target" } */