From 72ebe8c528387ac2ecf82f3ce82294f63a855d45 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 31 Jan 2020 10:21:02 +1030 Subject: [PATCH] Tidy bfd.pot This patch removes the leak of Nick's source directory into bfd.pot, and emits #line for some generated files so that those files aren't referenced by comments in the .pot file. You can see both of these effects in the following diff. I've also removed use of an unnecessary temp file in the make rules. @@ -92,10 +92,8 @@ msgstr "" #: elf64-nfp.c:238 elf64-ppc.c:1014 elf64-ppc.c:1349 elf64-ppc.c:1358 #: elf64-s390.c:328 elf64-s390.c:378 elf64-x86-64.c:285 elfn32-mips.c:3786 #: elfxx-ia64.c:324 elfxx-riscv.c:955 elfxx-sparc.c:589 elfxx-sparc.c:639 -#: elfxx-tilegx.c:912 elfxx-tilegx.c:952 -#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:2215 -#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:2313 elf32-ia64.c:214 -#: elf32-ia64.c:3862 elf64-ia64.c:214 elf64-ia64.c:3862 +#: elfxx-tilegx.c:912 elfxx-tilegx.c:952 elfnn-aarch64.c:2215 +#: elfnn-aarch64.c:2313 elfnn-ia64.c:214 elfnn-ia64.c:3862 #, c-format msgid "%pB: unsupported relocation type %#x" msgstr "" * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp file. Use $< and $@ in rules. (elf32-aarch64.c, elf64-aarch64.c): Likewise. (elf32-ia64.c, elf64-ia64.c): Likewise. (elf32-riscv.c, elf64-riscv.c): Likewise. (peigen.c, pepigen.c, pex64igen.c): Likewise. (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line. (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED). (elf32-ia64.c, elf64-ia64.c): Do emit #line. (peigen.c, pepigen.c, pex64igen.c): Likewise. * Makefile.in: Regenerate. --- bfd/ChangeLog | 14 ++++++++++++ bfd/Makefile.am | 57 +++++++++++++++++-------------------------------- bfd/Makefile.in | 57 +++++++++++++++++-------------------------------- 3 files changed, 54 insertions(+), 74 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0061b6f3557..59a787bf40c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,17 @@ +2020-01-31 Alan Modra + + * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp + file. Use $< and $@ in rules. + (elf32-aarch64.c, elf64-aarch64.c): Likewise. + (elf32-ia64.c, elf64-ia64.c): Likewise. + (elf32-riscv.c, elf64-riscv.c): Likewise. + (peigen.c, pepigen.c, pex64igen.c): Likewise. + (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line. + (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED). + (elf32-ia64.c, elf64-ia64.c): Do emit #line. + (peigen.c, pepigen.c, pex64igen.c): Likewise. + * Makefile.in: Regenerate. + 2020-01-31 Alan Modra PR 4110 diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 7053a678a74..b6088a3c4a8 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -827,63 +827,46 @@ endif endif elf32-target.h : elfxx-target.h - rm -f elf32-target.h - $(SED) -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new - mv -f elf32-target.new elf32-target.h + $(SED) -e s/NN/32/g < $< > $@ elf64-target.h : elfxx-target.h - rm -f elf64-target.h - $(SED) -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new - mv -f elf64-target.new elf64-target.h + $(SED) -e s/NN/64/g < $< > $@ elf32-aarch64.c : elfnn-aarch64.c - rm -f elf32-aarch64.c - echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf32-aarch64.new - $(SED) -e s/NN/32/g < $(srcdir)/elfnn-aarch64.c >> elf32-aarch64.new - mv -f elf32-aarch64.new elf32-aarch64.c + echo "#line 1 \"elfnn-aarch64.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-aarch64.c : elfnn-aarch64.c - rm -f elf64-aarch64.c - echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf64-aarch64.new - $(SED) -e s/NN/64/g < $(srcdir)/elfnn-aarch64.c >> elf64-aarch64.new - mv -f elf64-aarch64.new elf64-aarch64.c + echo "#line 1 \"elfnn-aarch64.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ elf32-ia64.c : elfnn-ia64.c - rm -f elf32-ia64.c - $(SED) -e s/NN/32/g < $(srcdir)/elfnn-ia64.c > elf32-ia64.new - mv -f elf32-ia64.new elf32-ia64.c + echo "#line 1 \"elfnn-ia64.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-ia64.c : elfnn-ia64.c - rm -f elf64-ia64.c - $(SED) -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new - mv -f elf64-ia64.new elf64-ia64.c + echo "#line 1 \"elfnn-ia64.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ elf32-riscv.c : elfnn-riscv.c - rm -f elf32-riscv.c - echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new - sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new - mv -f elf32-riscv.new elf32-riscv.c + echo "#line 1 \"elfnn-riscv.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-riscv.c : elfnn-riscv.c - rm -f elf64-riscv.c - echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new - sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new - mv -f elf64-riscv.new elf64-riscv.c + echo "#line 1 \"elfnn-riscv.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ peigen.c : peXXigen.c - rm -f peigen.c - $(SED) -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new - mv -f peigen.new peigen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pe/g < $< >> $@ pepigen.c : peXXigen.c - rm -f pepigen.c - $(SED) -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new - mv -f pepigen.new pepigen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pep/g < $< >> $@ pex64igen.c: peXXigen.c - rm -f pex64igen.c - $(SED) -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new - mv -f pex64igen.new pex64igen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pex64/g < $< >> $@ BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h LOCAL_H_DEPS= libbfd.h sysdep.h config.h bfd_stdint.h diff --git a/bfd/Makefile.in b/bfd/Makefile.in index c055a9e4a21..dd3474d92b0 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1959,63 +1959,46 @@ dwarf2.lo: dwarf2.c Makefile @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ -DDEBUGDIR=\"$(DEBUGDIR)\" $(srcdir)/dwarf2.c elf32-target.h : elfxx-target.h - rm -f elf32-target.h - $(SED) -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new - mv -f elf32-target.new elf32-target.h + $(SED) -e s/NN/32/g < $< > $@ elf64-target.h : elfxx-target.h - rm -f elf64-target.h - $(SED) -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new - mv -f elf64-target.new elf64-target.h + $(SED) -e s/NN/64/g < $< > $@ elf32-aarch64.c : elfnn-aarch64.c - rm -f elf32-aarch64.c - echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf32-aarch64.new - $(SED) -e s/NN/32/g < $(srcdir)/elfnn-aarch64.c >> elf32-aarch64.new - mv -f elf32-aarch64.new elf32-aarch64.c + echo "#line 1 \"elfnn-aarch64.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-aarch64.c : elfnn-aarch64.c - rm -f elf64-aarch64.c - echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf64-aarch64.new - $(SED) -e s/NN/64/g < $(srcdir)/elfnn-aarch64.c >> elf64-aarch64.new - mv -f elf64-aarch64.new elf64-aarch64.c + echo "#line 1 \"elfnn-aarch64.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ elf32-ia64.c : elfnn-ia64.c - rm -f elf32-ia64.c - $(SED) -e s/NN/32/g < $(srcdir)/elfnn-ia64.c > elf32-ia64.new - mv -f elf32-ia64.new elf32-ia64.c + echo "#line 1 \"elfnn-ia64.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-ia64.c : elfnn-ia64.c - rm -f elf64-ia64.c - $(SED) -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new - mv -f elf64-ia64.new elf64-ia64.c + echo "#line 1 \"elfnn-ia64.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ elf32-riscv.c : elfnn-riscv.c - rm -f elf32-riscv.c - echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new - sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new - mv -f elf32-riscv.new elf32-riscv.c + echo "#line 1 \"elfnn-riscv.c\"" > $@ + $(SED) -e s/NN/32/g < $< >> $@ elf64-riscv.c : elfnn-riscv.c - rm -f elf64-riscv.c - echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new - sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new - mv -f elf64-riscv.new elf64-riscv.c + echo "#line 1 \"elfnn-riscv.c\"" > $@ + $(SED) -e s/NN/64/g < $< >> $@ peigen.c : peXXigen.c - rm -f peigen.c - $(SED) -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new - mv -f peigen.new peigen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pe/g < $< >> $@ pepigen.c : peXXigen.c - rm -f pepigen.c - $(SED) -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new - mv -f pepigen.new pepigen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pep/g < $< >> $@ pex64igen.c: peXXigen.c - rm -f pex64igen.c - $(SED) -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new - mv -f pex64igen.new pex64igen.c + echo "#line 1 \"peXXigen.c\"" > $@ + $(SED) -e s/XX/pex64/g < $< >> $@ $(BFD32_LIBS) \ $(BFD64_LIBS) \ $(ALL_MACHINES) \ -- 2.30.2