[3/3] gas: re-use config/te-*.h

Message ID c079bf25-0709-423d-9287-d742e24d3432@suse.com
State New
Headers
Series gas: te-*.h and bfin tidying |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Jan Beulich Aug. 21, 2026, 1:18 p.m. UTC
  ... instead of spelling out all the same things repeatedly.
---
Some config/te-*.h use

#ifdef OBJ_HEADER
#include OBJ_HEADER
#else
#include "obj-format.h"
#endif

while others use(d) simply

#include "obj-format.h"

Why this difference?
  

Comments

John David Anglin Aug. 23, 2026, 6:29 p.m. UTC | #1
The hppa parts are okay.

Dave

On 2026-08-21 9:18 a.m., Jan Beulich wrote:
> ... instead of spelling out all the same things repeatedly.
> ---
> Some config/te-*.h use
> 
> #ifdef OBJ_HEADER
> #include OBJ_HEADER
> #else
> #include "obj-format.h"
> #endif
> 
> while others use(d) simply
> 
> #include "obj-format.h"
> 
> Why this difference?
> 
> --- a/gas/config/te-armeabi.h
> +++ b/gas/config/te-armeabi.h
> @@ -21,7 +21,4 @@
>  #define FPU_DEFAULT FPU_ARCH_SOFTVFP
>  #define EABI_DEFAULT EF_ARM_EABI_VER5
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-dragonfly.h
> +++ b/gas/config/te-dragonfly.h
> @@ -24,7 +24,4 @@
>     DragonFlyBSD kernel uses "/" to mean division.  (What a concept!)  */
>  #define TE_DragonFly 1
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-freebsd.h
> +++ b/gas/config/te-freebsd.h
> @@ -24,7 +24,4 @@
>     FreeBSD kernel uses "/" to mean division.  (What a concept!)  */
>  #define TE_FreeBSD 1
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-go32.h
> +++ b/gas/config/te-go32.h
> @@ -19,13 +19,9 @@
>  
>  #define TE_GO32
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
>  /* GAS should treat '.align value' as an alignment of 2**value.  */
>  #define USE_ALIGN_PTWO
>  
>  #define COFF_LONG_SECTION_NAMES
>  
> -/* These define interfaces.  */
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-haiku.h
> +++ b/gas/config/te-haiku.h
> @@ -24,7 +24,4 @@
>     haiku kernel uses "/" to mean division.  (What a concept!)  */
>  #define TE_Haiku 1
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-hppa64.h
> +++ b/gas/config/te-hppa64.h
> @@ -19,7 +19,4 @@
>  
>  #define TARGET_ARCH_SIZE 64
>  
> -/* Labels are not required to have a colon for a suffix.  */
> -#define LABELS_WITHOUT_COLONS 1
> -
> -#include "obj-format.h"
> +#include "te-hppa.h"
> --- a/gas/config/te-hppalinux64.h
> +++ b/gas/config/te-hppalinux64.h
> @@ -17,8 +17,6 @@
>     Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
>     02110-1301, USA.  */
>  
> -#define TE_LINUX
>  #define TARGET_ARCH_SIZE 64
> -#define LOCAL_LABELS_FB 1
>  
> -#include "obj-format.h"
> +#include "te-linux.h"
> --- a/gas/config/te-macos.h
> +++ b/gas/config/te-macos.h
> @@ -19,10 +19,4 @@
>  
>  #define TE_POWERMAC 1
>  
> -/* Added these, because if we don't know what we're targeting we may
> -   need an assembler version of libgcc, and that will use local
> -   labels.  */
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
> --- a/gas/config/te-pep.h
> +++ b/gas/config/te-pep.h
> @@ -20,10 +20,4 @@
>  #define TE_PEP
>  #define COFF_WITH_pex64
>  
> -#define TE_PE
> -#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels.  */
> -
> -/* The PE format supports long section names.  */
> -#define COFF_LONG_SECTION_NAMES
> -
> -#include "obj-format.h"
> +#include "te-pe.h"
> --- a/gas/config/te-pepaarch64.h
> +++ b/gas/config/te-pepaarch64.h
> @@ -20,10 +20,4 @@
>  #define TE_PEP
>  #define COFF_WITH_peAArch64
>  
> -#define TE_PE
> -#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels.  */
> -
> -/* The PE format supports long section names.  */
> -#define COFF_LONG_SECTION_NAMES
> -
> -#include "obj-format.h"
> +#include "te-pe.h"
> --- a/gas/config/te-solaris.h
> +++ b/gas/config/te-solaris.h
> @@ -19,10 +19,7 @@
>  
>  #define TE_SOLARIS
>  
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
> -
> -#include "obj-format.h"
> +#include "te-generic.h"
>  
>  /* The Sun linker doesn't merge read-only and read-write sections into
>     a single section so we must force all EH frame sections to use the
> --- a/gas/config/te-tmips.h
> +++ b/gas/config/te-tmips.h
> @@ -20,21 +20,10 @@
>  
>  /* This file is te-tmips.h and is intended to provide support for
>     traditional mips targets like mips-dde-sysv4.2MP (Supermax ) ,
> -   mips-sni-sysv4* (Sinix) etc. The base for this file is te-generic.h.
> +   mips-sni-sysv4* (Sinix) etc.
>     Created by Koundinya.K < kk@ddeorg.soft.net > with the help of
>     Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.  */
>  
> -/* Added these, because if we don't know what we're targeting we may
> -   need an assembler version of libgcc, and that will use local
> -   labels.  */
> -
>  #define TE_TMIPS 1
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
>  
> -/* these define interfaces */
> -#ifdef OBJ_HEADER
> -#include OBJ_HEADER
> -#else
> -#include "obj-format.h"
> -#endif
> +#include "te-generic.h"
> --- a/gas/config/te-vxworks.h
> +++ b/gas/config/te-vxworks.h
> @@ -19,12 +19,5 @@
>     02110-1301, USA.  */
>  
>  #define TE_VXWORKS	1
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
>  
> -/* these define interfaces */
> -#ifdef OBJ_HEADER
> -#include OBJ_HEADER
> -#else
> -#include "obj-format.h"
> -#endif
> +#include "te-generic.h"
  
Maciej W. Rozycki Aug. 25, 2026, 12:38 p.m. UTC | #2
On Fri, 21 Aug 2026, Jan Beulich wrote:

> --- a/gas/config/te-tmips.h
> +++ b/gas/config/te-tmips.h
> @@ -20,21 +20,10 @@
>  
>  /* This file is te-tmips.h and is intended to provide support for
>     traditional mips targets like mips-dde-sysv4.2MP (Supermax ) ,
> -   mips-sni-sysv4* (Sinix) etc. The base for this file is te-generic.h.
> +   mips-sni-sysv4* (Sinix) etc.
>     Created by Koundinya.K < kk@ddeorg.soft.net > with the help of
>     Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.  */
>  
> -/* Added these, because if we don't know what we're targeting we may
> -   need an assembler version of libgcc, and that will use local
> -   labels.  */
> -
>  #define TE_TMIPS 1
> -#define LOCAL_LABELS_DOLLAR 1
> -#define LOCAL_LABELS_FB 1
>  
> -/* these define interfaces */
> -#ifdef OBJ_HEADER
> -#include OBJ_HEADER
> -#else
> -#include "obj-format.h"
> -#endif
> +#include "te-generic.h"

 This seems good if not obvious to me, and didn't cause any regressions 
across my usual set of MIPS targets.

 Obviously none of the `mips*-*-sysv*' is supported anymore, so I'll have 
to update the comment accordingly, and e.g. gas/configure.tgt asks for an 
update as well.

 Thank you for doing this cleanup.

  Maciej
  

Patch

--- a/gas/config/te-armeabi.h
+++ b/gas/config/te-armeabi.h
@@ -21,7 +21,4 @@ 
 #define FPU_DEFAULT FPU_ARCH_SOFTVFP
 #define EABI_DEFAULT EF_ARM_EABI_VER5
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-dragonfly.h
+++ b/gas/config/te-dragonfly.h
@@ -24,7 +24,4 @@ 
    DragonFlyBSD kernel uses "/" to mean division.  (What a concept!)  */
 #define TE_DragonFly 1
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-freebsd.h
+++ b/gas/config/te-freebsd.h
@@ -24,7 +24,4 @@ 
    FreeBSD kernel uses "/" to mean division.  (What a concept!)  */
 #define TE_FreeBSD 1
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-go32.h
+++ b/gas/config/te-go32.h
@@ -19,13 +19,9 @@ 
 
 #define TE_GO32
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
 /* GAS should treat '.align value' as an alignment of 2**value.  */
 #define USE_ALIGN_PTWO
 
 #define COFF_LONG_SECTION_NAMES
 
-/* These define interfaces.  */
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-haiku.h
+++ b/gas/config/te-haiku.h
@@ -24,7 +24,4 @@ 
    haiku kernel uses "/" to mean division.  (What a concept!)  */
 #define TE_Haiku 1
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-hppa64.h
+++ b/gas/config/te-hppa64.h
@@ -19,7 +19,4 @@ 
 
 #define TARGET_ARCH_SIZE 64
 
-/* Labels are not required to have a colon for a suffix.  */
-#define LABELS_WITHOUT_COLONS 1
-
-#include "obj-format.h"
+#include "te-hppa.h"
--- a/gas/config/te-hppalinux64.h
+++ b/gas/config/te-hppalinux64.h
@@ -17,8 +17,6 @@ 
    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#define TE_LINUX
 #define TARGET_ARCH_SIZE 64
-#define LOCAL_LABELS_FB 1
 
-#include "obj-format.h"
+#include "te-linux.h"
--- a/gas/config/te-macos.h
+++ b/gas/config/te-macos.h
@@ -19,10 +19,4 @@ 
 
 #define TE_POWERMAC 1
 
-/* Added these, because if we don't know what we're targeting we may
-   need an assembler version of libgcc, and that will use local
-   labels.  */
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
--- a/gas/config/te-pep.h
+++ b/gas/config/te-pep.h
@@ -20,10 +20,4 @@ 
 #define TE_PEP
 #define COFF_WITH_pex64
 
-#define TE_PE
-#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels.  */
-
-/* The PE format supports long section names.  */
-#define COFF_LONG_SECTION_NAMES
-
-#include "obj-format.h"
+#include "te-pe.h"
--- a/gas/config/te-pepaarch64.h
+++ b/gas/config/te-pepaarch64.h
@@ -20,10 +20,4 @@ 
 #define TE_PEP
 #define COFF_WITH_peAArch64
 
-#define TE_PE
-#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels.  */
-
-/* The PE format supports long section names.  */
-#define COFF_LONG_SECTION_NAMES
-
-#include "obj-format.h"
+#include "te-pe.h"
--- a/gas/config/te-solaris.h
+++ b/gas/config/te-solaris.h
@@ -19,10 +19,7 @@ 
 
 #define TE_SOLARIS
 
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
-
-#include "obj-format.h"
+#include "te-generic.h"
 
 /* The Sun linker doesn't merge read-only and read-write sections into
    a single section so we must force all EH frame sections to use the
--- a/gas/config/te-tmips.h
+++ b/gas/config/te-tmips.h
@@ -20,21 +20,10 @@ 
 
 /* This file is te-tmips.h and is intended to provide support for
    traditional mips targets like mips-dde-sysv4.2MP (Supermax ) ,
-   mips-sni-sysv4* (Sinix) etc. The base for this file is te-generic.h.
+   mips-sni-sysv4* (Sinix) etc.
    Created by Koundinya.K < kk@ddeorg.soft.net > with the help of
    Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.  */
 
-/* Added these, because if we don't know what we're targeting we may
-   need an assembler version of libgcc, and that will use local
-   labels.  */
-
 #define TE_TMIPS 1
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
 
-/* these define interfaces */
-#ifdef OBJ_HEADER
-#include OBJ_HEADER
-#else
-#include "obj-format.h"
-#endif
+#include "te-generic.h"
--- a/gas/config/te-vxworks.h
+++ b/gas/config/te-vxworks.h
@@ -19,12 +19,5 @@ 
    02110-1301, USA.  */
 
 #define TE_VXWORKS	1
-#define LOCAL_LABELS_DOLLAR 1
-#define LOCAL_LABELS_FB 1
 
-/* these define interfaces */
-#ifdef OBJ_HEADER
-#include OBJ_HEADER
-#else
-#include "obj-format.h"
-#endif
+#include "te-generic.h"