public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gas, aarch64]: fix build breakage for aarch64-pe
@ 2022-11-16 23:21 Indu Bhagat
  2022-11-17  3:29 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Indu Bhagat @ 2022-11-16 23:21 UTC (permalink / raw)
  To: binutils; +Cc: zac.walker, Indu Bhagat

Hi,

  This patch should fix the build breakage on aarch64-pe caused by the SFrame
  patch series.

  The issue was that the definitions related to SFrame APIs were not guarded by
  OBJ_ELF, they were errneously guarded by a more relaxed condition of OBJ_ELF
  || OBJ_COFF, hence causing build failures.

Testing notes:
  - Tested build and make -k check for selected folders for --target=aarch64-pe.

Thanks
Indu

---------------------

SFrame is supported for ELF only.  Keep the definitions and declarations
guarded with OBJ_ELF consistently.

ChangeLog:

	* gas/config/tc-aarch64.h:  Guard SFrame related definitions
	  with OBJ_ELF.
---
 gas/config/tc-aarch64.h | 42 ++++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index 91412ce8292..00efc26263c 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -239,6 +239,28 @@ struct aarch64_segment_info_type
 /* We want .cfi_* pseudo-ops for generating unwind info.  */
 #define TARGET_USE_CFIPOP              1
 
+/* CFI hooks.  */
+#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
+#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
+
+extern void aarch64_after_parse_args (void);
+#define md_after_parse_args() aarch64_after_parse_args ()
+
+#else /* Neither OBJ_ELF nor OBJ_COFF.  */
+#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
+#endif
+
+#if defined OBJ_ELF || defined OBJ_COFF
+
+# define EXTERN_FORCE_RELOC 			1
+# define tc_fix_adjustable(FIX) 		1
+/* Values passed to md_apply_fix don't include the symbol value.  */
+# define MD_APPLY_SYM_VALUE(FIX) 		0
+
+#endif
+
+#ifdef OBJ_ELF
+
 /* Whether SFrame unwind info is supported.  */
 extern bool aarch64_support_sframe_p (void);
 #define support_sframe_p aarch64_support_sframe_p
@@ -268,25 +290,7 @@ extern offsetT aarch64_sframe_cfa_ra_offset (void);
 unsigned char aarch64_sframe_get_abi_arch (void);
 #define sframe_get_abi_arch aarch64_sframe_get_abi_arch
 
-/* CFI hooks.  */
-#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
-#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
-
-extern void aarch64_after_parse_args (void);
-#define md_after_parse_args() aarch64_after_parse_args ()
-
-#else /* Not OBJ_ELF.  */
-#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
-#endif
-
-#if defined OBJ_ELF || defined OBJ_COFF
-
-# define EXTERN_FORCE_RELOC 			1
-# define tc_fix_adjustable(FIX) 		1
-/* Values passed to md_apply_fix don't include the symbol value.  */
-# define MD_APPLY_SYM_VALUE(FIX) 		0
-
-#endif
+#endif /* OBJ_ELF  */
 
 #define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S)
 
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [gas, aarch64]: fix build breakage for aarch64-pe
  2022-11-16 23:21 [PATCH] [gas, aarch64]: fix build breakage for aarch64-pe Indu Bhagat
@ 2022-11-17  3:29 ` Alan Modra
  2022-11-17  6:02   ` [PATCH,V2] " Indu Bhagat
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2022-11-17  3:29 UTC (permalink / raw)
  To: Indu Bhagat; +Cc: binutils, zac.walker

On Wed, Nov 16, 2022 at 03:21:32PM -0800, Indu Bhagat via Binutils wrote:
> --- a/gas/config/tc-aarch64.h
> +++ b/gas/config/tc-aarch64.h
> @@ -239,6 +239,28 @@ struct aarch64_segment_info_type
>  /* We want .cfi_* pseudo-ops for generating unwind info.  */
>  #define TARGET_USE_CFIPOP              1
>  
> +/* CFI hooks.  */
> +#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
> +#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
> +
> +extern void aarch64_after_parse_args (void);
> +#define md_after_parse_args() aarch64_after_parse_args ()
> +
> +#else /* Neither OBJ_ELF nor OBJ_COFF.  */
> +#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
> +#endif
> +
> +#if defined OBJ_ELF || defined OBJ_COFF
> +
> +# define EXTERN_FORCE_RELOC 			1
> +# define tc_fix_adjustable(FIX) 		1
> +/* Values passed to md_apply_fix don't include the symbol value.  */
> +# define MD_APPLY_SYM_VALUE(FIX) 		0

OK, but seeing as you are moving things around, let's move the above
three defines before the #else to get rid of another #if.

> +
> +#endif
> +
> +#ifdef OBJ_ELF
> +
>  /* Whether SFrame unwind info is supported.  */
>  extern bool aarch64_support_sframe_p (void);
>  #define support_sframe_p aarch64_support_sframe_p
> @@ -268,25 +290,7 @@ extern offsetT aarch64_sframe_cfa_ra_offset (void);
>  unsigned char aarch64_sframe_get_abi_arch (void);
>  #define sframe_get_abi_arch aarch64_sframe_get_abi_arch
>  
> -/* CFI hooks.  */
> -#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
> -#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
> -
> -extern void aarch64_after_parse_args (void);
> -#define md_after_parse_args() aarch64_after_parse_args ()
> -
> -#else /* Not OBJ_ELF.  */
> -#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
> -#endif
> -
> -#if defined OBJ_ELF || defined OBJ_COFF
> -
> -# define EXTERN_FORCE_RELOC 			1
> -# define tc_fix_adjustable(FIX) 		1
> -/* Values passed to md_apply_fix don't include the symbol value.  */
> -# define MD_APPLY_SYM_VALUE(FIX) 		0
> -
> -#endif
> +#endif /* OBJ_ELF  */
>  
>  #define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S)
>  
> -- 
> 2.37.2

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH,V2] [gas, aarch64]: fix build breakage for aarch64-pe
  2022-11-17  3:29 ` Alan Modra
@ 2022-11-17  6:02   ` Indu Bhagat
  0 siblings, 0 replies; 3+ messages in thread
From: Indu Bhagat @ 2022-11-17  6:02 UTC (permalink / raw)
  To: binutils; +Cc: zac.walker, amodra, Indu Bhagat

[Changes in V2]
  - Combine the two distinct stubs guarded by OBJ_ELF || OBJ_COFF into one.
[End of changes in V2]

SFrame is supported for ELF only.  Keep the definitions and declarations
guarded with OBJ_ELF consistently.

ChangeLog:

	* gas/config/tc-aarch64.h:  Guard SFrame related definitions
	  with OBJ_ELF.
---
 gas/config/tc-aarch64.h | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index 91412ce8292..df73516022f 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -239,6 +239,27 @@ struct aarch64_segment_info_type
 /* We want .cfi_* pseudo-ops for generating unwind info.  */
 #define TARGET_USE_CFIPOP              1
 
+/* CFI hooks.  */
+#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
+#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
+
+extern void aarch64_after_parse_args (void);
+#define md_after_parse_args() aarch64_after_parse_args ()
+
+# define EXTERN_FORCE_RELOC 			1
+# define tc_fix_adjustable(FIX) 		1
+
+/* Values passed to md_apply_fix don't include the symbol value.  */
+# define MD_APPLY_SYM_VALUE(FIX) 		0
+
+#else /* Neither OBJ_ELF nor OBJ_COFF.  */
+
+#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
+
+#endif /*  OBJ_ELF || OBJ_COFF.  */
+
+#ifdef OBJ_ELF
+
 /* Whether SFrame unwind info is supported.  */
 extern bool aarch64_support_sframe_p (void);
 #define support_sframe_p aarch64_support_sframe_p
@@ -268,25 +289,7 @@ extern offsetT aarch64_sframe_cfa_ra_offset (void);
 unsigned char aarch64_sframe_get_abi_arch (void);
 #define sframe_get_abi_arch aarch64_sframe_get_abi_arch
 
-/* CFI hooks.  */
-#define tc_regname_to_dw2regnum            tc_aarch64_regname_to_dw2regnum
-#define tc_cfi_frame_initial_instructions  tc_aarch64_frame_initial_instructions
-
-extern void aarch64_after_parse_args (void);
-#define md_after_parse_args() aarch64_after_parse_args ()
-
-#else /* Not OBJ_ELF.  */
-#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
-#endif
-
-#if defined OBJ_ELF || defined OBJ_COFF
-
-# define EXTERN_FORCE_RELOC 			1
-# define tc_fix_adjustable(FIX) 		1
-/* Values passed to md_apply_fix don't include the symbol value.  */
-# define MD_APPLY_SYM_VALUE(FIX) 		0
-
-#endif
+#endif /* OBJ_ELF  */
 
 #define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S)
 
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-17  6:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 23:21 [PATCH] [gas, aarch64]: fix build breakage for aarch64-pe Indu Bhagat
2022-11-17  3:29 ` Alan Modra
2022-11-17  6:02   ` [PATCH,V2] " Indu Bhagat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).