[PATCH 0/5] Add lto and none-lto input support for ld -r

H.J. Lu hjl.tools@gmail.com
Wed Oct 21 11:35:06 GMT 2020


We generate a mixed ET_REL object with ld -r from non-IR ET_REL objects
and IR ET_REL objects, which contains IR sections and a special non-IR
section.  When generating ET_EXEC or ET_DYN output, linker extracts an
non-IR ET_REL object from the special non-IR section in the mixed ET_REL
object and adds it to the list of linker inputs.

H.J. Lu (5):
  Don't claim a fat IR object if no IR object should be claimed
  ld: Add lto and none-lto input support for ld -r
  Add test for nm on mixed LTO/non-LTO object
  Don't check the plugin target twice
  ld: Ignore the new weak definition if needed

 bfd/bfd-in2.h                     |   24 +-
 bfd/bfd.c                         |   53 ++
 bfd/elf.c                         |    1 +
 bfd/elflink.c                     |   12 +
 bfd/format.c                      |   97 ++-
 bfd/opncls.c                      |   66 ++
 bfd/plugin.c                      |  194 +++++-
 bfd/plugin.h                      |    2 +
 bfd/section.c                     |    3 +
 binutils/objcopy.c                |   32 +-
 binutils/readelf.c                |    1 +
 gas/testsuite/gas/elf/section9.d  |    1 +
 gas/testsuite/gas/elf/section9.s  |    2 +
 include/bfdlink.h                 |    6 +
 include/elf/common.h              |    1 +
 ld/emultempl/aarch64elf.em        |    2 +-
 ld/emultempl/alphaelf.em          |    2 +-
 ld/emultempl/armelf.em            |    2 +-
 ld/emultempl/avrelf.em            |    2 +-
 ld/emultempl/elf.em               |    2 +-
 ld/emultempl/ppc32elf.em          |    2 +-
 ld/emultempl/ppc64elf.em          |    2 +-
 ld/emultempl/spuelf.em            |    2 +-
 ld/ldelf.c                        |   24 +-
 ld/ldelf.h                        |    1 +
 ld/ldexp.c                        |   16 +-
 ld/ldexp.h                        |    4 +-
 ld/ldfile.c                       |    2 +
 ld/ldlang.c                       | 1024 ++++++++++++++++++++++++++++-
 ld/ldlang.h                       |   43 +-
 ld/ldlex.h                        |    1 +
 ld/ldmain.c                       |   84 ++-
 ld/ldmain.h                       |    2 +
 ld/lexsup.c                       |    6 +
 ld/plugin.c                       |   25 +-
 ld/plugin.h                       |    3 +
 ld/scripttempl/armbpabi.sc        |    2 +-
 ld/scripttempl/elf.sc             |    2 +-
 ld/scripttempl/elf64hppa.sc       |    2 +-
 ld/scripttempl/elfxtensa.sc       |    2 +-
 ld/scripttempl/mep.sc             |    2 +-
 ld/scripttempl/pe.sc              |    1 +
 ld/scripttempl/pep.sc             |    1 +
 ld/testsuite/ld-plugin/lto-10.out |    1 +
 ld/testsuite/ld-plugin/lto-10a.c  |    6 +
 ld/testsuite/ld-plugin/lto-10b.c  |    7 +
 ld/testsuite/ld-plugin/lto-10r.d  |    9 +
 ld/testsuite/ld-plugin/lto-4.out  |    2 +
 ld/testsuite/ld-plugin/lto-4a.c   |    7 +
 ld/testsuite/ld-plugin/lto-4b.c   |    9 +
 ld/testsuite/ld-plugin/lto-4c.c   |    6 +
 ld/testsuite/ld-plugin/lto-4r-a.d |    7 +
 ld/testsuite/ld-plugin/lto-4r-b.d |    7 +
 ld/testsuite/ld-plugin/lto-4r-c.d |    7 +
 ld/testsuite/ld-plugin/lto-4r-d.d |    7 +
 ld/testsuite/ld-plugin/lto.exp    |   93 ++-
 ld/testsuite/ld-plugin/pr23935a.c |    2 +
 ld/testsuite/ld-plugin/pr23935b.c |    2 +
 58 files changed, 1801 insertions(+), 129 deletions(-)
 create mode 100644 ld/testsuite/ld-plugin/lto-10.out
 create mode 100644 ld/testsuite/ld-plugin/lto-10a.c
 create mode 100644 ld/testsuite/ld-plugin/lto-10b.c
 create mode 100644 ld/testsuite/ld-plugin/lto-10r.d
 create mode 100644 ld/testsuite/ld-plugin/lto-4.out
 create mode 100644 ld/testsuite/ld-plugin/lto-4a.c
 create mode 100644 ld/testsuite/ld-plugin/lto-4b.c
 create mode 100644 ld/testsuite/ld-plugin/lto-4c.c
 create mode 100644 ld/testsuite/ld-plugin/lto-4r-a.d
 create mode 100644 ld/testsuite/ld-plugin/lto-4r-b.d
 create mode 100644 ld/testsuite/ld-plugin/lto-4r-c.d
 create mode 100644 ld/testsuite/ld-plugin/lto-4r-d.d
 create mode 100644 ld/testsuite/ld-plugin/pr23935a.c
 create mode 100644 ld/testsuite/ld-plugin/pr23935b.c

-- 
2.26.2



More information about the Binutils mailing list