aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.cc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-11-15 12:00:47 +0100
committerFlorian Weimer <fweimer@redhat.com>2024-11-15 12:00:47 +0100
commit71bf2bef5e99aad810eb65847d878360a0042a02 (patch)
treeb4c7d761d574c51db90a6f0abbab233862d83923 /gcc/varasm.cc
parent9676da9fc26c9be62a1e862b29165177aa95120f (diff)
downloadgcc-71bf2bef5e99aad810eb65847d878360a0042a02.zip
gcc-71bf2bef5e99aad810eb65847d878360a0042a02.tar.gz
gcc-71bf2bef5e99aad810eb65847d878360a0042a02.tar.bz2
Report the section name in case of section type conflicts
The section name might the user a hint of what is going on. gcc/ * varasm.cc (get_section): Include name of section in diagnostic messages.
Diffstat (limited to 'gcc/varasm.cc')
-rw-r--r--gcc/varasm.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/varasm.cc b/gcc/varasm.cc
index 0712b48..acc4b4a 100644
--- a/gcc/varasm.cc
+++ b/gcc/varasm.cc
@@ -355,17 +355,20 @@ get_section (const char *name, unsigned int flags, tree decl,
&& decl != sect->named.decl)
{
if (decl != NULL && DECL_P (decl))
- error ("%+qD causes a section type conflict with %qD",
- decl, sect->named.decl);
+ error ("%+qD causes a section type conflict with %qD"
+ " in section %qs",
+ decl, sect->named.decl, name);
else
- error ("section type conflict with %qD", sect->named.decl);
+ error ("section type conflict with %qD in section %qs",
+ sect->named.decl, name);
inform (DECL_SOURCE_LOCATION (sect->named.decl),
"%qD was declared here", sect->named.decl);
}
else if (decl != NULL && DECL_P (decl))
- error ("%+qD causes a section type conflict", decl);
+ error ("%+qD causes a section type conflict for section %qs",
+ decl, name);
else
- error ("section type conflict");
+ error ("section type conflict for section %qs", name);
/* Make sure we don't error about one section multiple times. */
sect->common.flags |= SECTION_OVERRIDE;
}