]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/binutils-tumbl.git/commitdiff
PR gas/14521
authorHans-Peter Nilsson <hp@axis.com>
Mon, 10 Sep 2012 10:05:02 +0000 (10:05 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Mon, 10 Sep 2012 10:05:02 +0000 (10:05 +0000)
* config/tc-mmix.h (tc_frob_file_before_fix): Renumber sections
after call to mmix_frob_file.

gas/ChangeLog
gas/config/tc-mmix.h

index dc5b303954337f44f520a411b57e8d937eca8935..f2a949cc9fd2bba1e50bd2e34435058e5af22422 100644 (file)
@@ -1,5 +1,9 @@
 2012-09-10  Hans-Peter Nilsson  <hp@bitrange.com>
 
+       PR gas/14521
+       * config/tc-mmix.h (tc_frob_file_before_fix): Renumber sections
+       after call to mmix_frob_file.
+
        * config/tc-mmix.c (loc_asserts): New variable.
        (mmix_greg_internal): Handle expressions not determinable at first
        pass.
index ef901620a825a81ad2fe80863a676ebeeed74f79..dba24a2d38c451559724b6ba31f4e8523a02a91b 100644 (file)
@@ -194,7 +194,18 @@ extern fragS *mmix_opcode_frag;
    fixups are done and relocs are output.  Similarly for each unknown
    symbol.  */
 extern void mmix_frob_file (void);
-#define tc_frob_file_before_fix mmix_frob_file
+#define tc_frob_file_before_fix()                                      \
+  do                                                                   \
+    {                                                                  \
+      int i = 0;                                                       \
+                                                                       \
+      /* It's likely mmix_frob_file changed (removed) sections, so make        \
+        sure sections are correctly numbered as per renumber_sections, \
+        (static to write.c where this macro is called).  */            \
+      mmix_frob_file ();                                               \
+      bfd_map_over_sections (stdoutput, renumber_sections, &i);                \
+    }                                                                  \
+  while (0)
 
 /* Used by mmix_frob_file.  Hangs on section symbols and unknown symbols.  */
 struct mmix_symbol_gregs;