Make the assembler generate an error if there is an attempt to define a section with...
[deliverable/binutils-gdb.git] / gas / config / obj-elf.c
index ffc5508532f43a03e46509324a09fc45811b0eba..7cf921c051f62b4cd73b867e7d203cc3fec284fe 100644 (file)
@@ -1039,6 +1039,18 @@ obj_elf_section (int push)
   name = obj_elf_section_name ();
   if (name == NULL)
     return;
+
+  symbolS * sym;
+  if ((sym = symbol_find (name)) != NULL
+      && ! symbol_section_p (sym)
+      && S_IS_DEFINED (sym)
+      && ! S_IS_VOLATILE (sym)
+      && ! S_CAN_BE_REDEFINED (sym))
+    {
+      as_bad (_("section name '%s' already defined as another symbol"), name);
+      ignore_rest_of_line ();
+      return;
+    }
   type = SHT_NULL;
   attr = 0;
   gnu_attr = 0;
This page took 0.022317 seconds and 4 git commands to generate.