Matthieu Longo <matthieu.lo...@arm.com> writes: > gcc/ChangeLog: > > * config.gcc: Add aarch64-dwarf-metadata.o to extra_objs. > * config/aarch64/aarch64-dwarf-metadata.h (class > section_note_gnu_property): > Encapsulate GNU properties code into a class. > * config/aarch64/aarch64.cc > (GNU_PROPERTY_AARCH64_FEATURE_1_AND): Define. > (GNU_PROPERTY_AARCH64_FEATURE_1_BTI): Likewise. > (GNU_PROPERTY_AARCH64_FEATURE_1_PAC): Likewise. > (GNU_PROPERTY_AARCH64_FEATURE_1_GCS): Likewise. > (aarch64_file_end_indicate_exec_stack): Move GNU properties code to > aarch64-dwarf-metadata.cc > * config/aarch64/t-aarch64: Declare target aarch64-dwarf-metadata.o > * config/aarch64/aarch64-dwarf-metadata.cc: New file. > --- > gcc/config.gcc | 2 +- > gcc/config/aarch64/aarch64-dwarf-metadata.cc | 120 +++++++++++++++++++ > gcc/config/aarch64/aarch64-dwarf-metadata.h | 19 +++ > gcc/config/aarch64/aarch64.cc | 87 +------------- > gcc/config/aarch64/t-aarch64 | 7 ++ > 5 files changed, 153 insertions(+), 82 deletions(-) > create mode 100644 gcc/config/aarch64/aarch64-dwarf-metadata.cc > > diff --git a/gcc/config.gcc b/gcc/config.gcc > index f09ce9f63a0..b448c2a91d1 100644 > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -351,7 +351,7 @@ aarch64*-*-*) > c_target_objs="aarch64-c.o" > cxx_target_objs="aarch64-c.o" > d_target_objs="aarch64-d.o" > - extra_objs="aarch64-builtins.o aarch-common.o aarch64-sve-builtins.o > aarch64-sve-builtins-shapes.o aarch64-sve-builtins-base.o > aarch64-sve-builtins-sve2.o aarch64-sve-builtins-sme.o > cortex-a57-fma-steering.o aarch64-speculation.o > falkor-tag-collision-avoidance.o aarch-bti-insert.o aarch64-cc-fusion.o > aarch64-early-ra.o aarch64-ldp-fusion.o" > + extra_objs="aarch64-builtins.o aarch-common.o aarch64-dwarf-metadata.o > aarch64-sve-builtins.o aarch64-sve-builtins-shapes.o > aarch64-sve-builtins-base.o aarch64-sve-builtins-sve2.o > aarch64-sve-builtins-sme.o cortex-a57-fma-steering.o aarch64-speculation.o > falkor-tag-collision-avoidance.o aarch-bti-insert.o aarch64-cc-fusion.o > aarch64-early-ra.o aarch64-ldp-fusion.o" > target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.h > \$(srcdir)/config/aarch64/aarch64-builtins.cc > \$(srcdir)/config/aarch64/aarch64-sve-builtins.h > \$(srcdir)/config/aarch64/aarch64-sve-builtins.cc" > target_has_targetm_common=yes > ;; > diff --git a/gcc/config/aarch64/aarch64-dwarf-metadata.cc > b/gcc/config/aarch64/aarch64-dwarf-metadata.cc > new file mode 100644 > index 00000000000..36659862b59 > --- /dev/null > +++ b/gcc/config/aarch64/aarch64-dwarf-metadata.cc > @@ -0,0 +1,120 @@
Missing copyright & licence. > +#define INCLUDE_STRING > +#define INCLUDE_ALGORITHM > +#define INCLUDE_MEMORY > +#define INCLUDE_VECTOR > +#include "config.h" > +#include "system.h" > +#include "coretypes.h" > +#include "backend.h" > +#include "target.h" > +#include "rtl.h" > +#include "output.h" > + > +#include "aarch64-dwarf-metadata.h" > + > [...] > diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64 > index c2a0715e9ab..194e3a4ac99 100644 > --- a/gcc/config/aarch64/t-aarch64 > +++ b/gcc/config/aarch64/t-aarch64 > @@ -139,6 +139,13 @@ aarch-common.o: $(srcdir)/config/arm/aarch-common.cc > $(CONFIG_H) $(SYSTEM_H) \ > $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ > $(srcdir)/config/arm/aarch-common.cc > > +aarch64-dwarf-metadata.o: $(srcdir)/config/aarch64/aarch64-dwarf-metadata.cc > \ > + $(CONFIG_H) \ > + $(SYSTEM_H) \ > + $(TARGET_H) Looks like this also needs: $(RTL_H) output.h aarch64-dwarf-metadata.h The comments for patch 1 apply to this refactored version too, but otherwise it looks good. Thanks, Richard > + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_SPPFLAGS) $(INCLUDES) \ > + $(srcdir)/config/aarch64/aarch64-dwarf-metadata.cc > + > aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.cc $(CONFIG_H) $(SYSTEM_H) \ > coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H) > $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \