From: Andi Kleen Date: Thu, 9 Jun 2011 06:22:17 +0000 (+0000) Subject: better warning for section conflict X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f2e22ff77819ca19eff4da9e2430943f95d5947;p=gcc.git better warning for section conflict gcc/: 2011-06-08 Andi Kleen * varasm.c (get_section): Print location of other conflict for section conflicts. From-SVN: r174836 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 820bcbd0676..1c9fa02276c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-08 Andi Kleen + + * varasm.c (get_section): Print location of other conflict + for section conflicts. + 2011-06-08 Andi Kleen * config/i386/driver-i386.c (host_detect_local_cpu): diff --git a/gcc/varasm.c b/gcc/varasm.c index 3311c86a9ea..a0a0582be76 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -313,7 +313,11 @@ get_section (const char *name, unsigned int flags, tree decl) if (decl == 0) decl = sect->named.decl; gcc_assert (decl); - error ("%+D causes a section type conflict", decl); + error ("%+D causes a section type conflict with %D", + decl, sect->named.decl); + if (decl != sect->named.decl) + inform (DECL_SOURCE_LOCATION (sect->named.decl), + "%qD was declared here", sect->named.decl); /* Make sure we don't error about one section multiple times. */ sect->common.flags |= SECTION_OVERRIDE; }