]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: move obj_begin earlier
authorAlan Modra <amodra@gmail.com>
Fri, 23 Jan 2026 23:22:40 +0000 (09:52 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 24 Jan 2026 00:13:40 +0000 (10:43 +1030)
csky wants to set up ELF object attributes in its md_begin.

* as.c (perform_an_assembly_pass): Move obj_begin earlier.
* testsuite/gas/mmix/builtin1.d,
* testsuite/gas/mmix/builtin3.d: Adjust expected output.

gas/as.c
gas/testsuite/gas/mmix/builtin1.d
gas/testsuite/gas/mmix/builtin3.d

index 6492bf1351f1d77920b692702299a05e7d3ab7d2..f08c7c71d73d7ff322f9254714291f0953fdfcca 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1266,16 +1266,16 @@ perform_an_assembly_pass (int argc, char ** argv)
   if (strstr (BFD_VERSION_STRING, "." XSTRING (BFD_VERSION_DATE)) != NULL)
     predefine_symbol ("date", BFD_VERSION_DATE);
 
+#ifdef obj_begin
+  obj_begin ();
+#endif
+
   /* This may add symbol table entries, which requires having an open BFD,
      and sections already created.  */
   md_begin ();
-
 #ifdef USING_CGEN
   gas_cgen_begin ();
 #endif
-#ifdef obj_begin
-  obj_begin ();
-#endif
 
   /* Skip argv[0].  */
   argv++;
index 17d13bbfa6858f70bdfcc1cb08f5b01dc2b3436a..c03a287a401e2fecadf15d3efdeb8521b065f25f 100644 (file)
@@ -6,10 +6,10 @@
 .*:     file format elf64-mmix
 
 SYMBOL TABLE:
-0+14 l       \*ABS\*   0+ rJ
 0+ l    d  \.text      0+ (|\.text)
 0+ l    d  \.data      0+ (|\.data)
 0+ l    d  \.bss       0+ (|\.bss)
+0+14 l       \*ABS\*   0+ rJ
 0+ g     F \.text      0+ Main
 
 
index 74801a6d548103e3d0196d1c88394e7ee138f09c..29455374db6c2f5180ce81e1b6452a3105b0951f 100644 (file)
@@ -8,10 +8,10 @@
 .*:     file format elf64-mmix
 
 SYMBOL TABLE:
-0+14 l       \*ABS\*   0+ rJ
 0+ l    d  \.text      0+ (|\.text)
 0+ l    d  \.data      0+ (|\.data)
 0+ l    d  \.bss       0+ (|\.bss)
+0+14 l       \*ABS\*   0+ rJ
 0+ g     F \.text      0+ Main