Files
binutils-gdb/ld/testsuite/ld-plugin
H.J. Lu 9b383903e7 strip: Treat slim GCC/LLVM IR objects the same
Slim LLVM IR object is a standalone file whose first 4 bytes are 'B',
'C', 0xc0, 0xde.  GCC IR object is regular ELF object with sections
whose names start with .gnu.lto_.* or .gnu.debuglto_.*.  GCC IR object
uses a .gnu.lto_.lto.<some_hash> section to encode the LTO bytecode
information:

struct lto_section
{
  int16_t major_version;
  int16_t minor_version;
  unsigned char slim_object;

  /* Flags is a private field that is not defined publicly.  */
  uint16_t flags;
};

In slim GCC IR object, the slim_object field is non-zero.  Strip should
treat slim GCC/LLVM IR objects the same.  Since strip won't change slim
LLVM IR objects, it should leave slim GCC IR object unchanged even when
asked to remove all IR objects:

1. Set the lto_type field to lto_slim_ir_object for slim LLVM IR object.
2. Always copy slim IR object as unknown object.

bfd/

	PR binutils/33271
	* format.c (bfd_set_lto_type): Set the lto_type field to
	lto_slim_ir_object for slim LLVM IR object.

binutils/

	PR binutils/33271
	* objcopy.c (lto_sections_removed): Removed.
	(copy_archive): Always copy slim IR object as unknown object.
	(copy_file): Likewise.
	(strip_main): Updated.

ld/

	PR binutils/33271
	* testsuite/ld-plugin/lto-binutils.exp: Don't check if fat IR is
	available when running slim IR tests.
	* testsuite/ld-plugin/strip-1a-s-all.nd: Expect full symbol list.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-14 18:12:36 -07:00
..
2024-08-22 06:34:53 -07:00
2024-08-22 06:34:53 -07:00
2020-09-09 12:36:59 +09:30
2020-09-09 12:36:59 +09:30
2020-09-10 18:58:51 +09:30
2020-09-10 18:58:51 +09:30
2020-09-09 12:36:59 +09:30
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2023-07-06 09:53:18 +08:00
2021-02-04 05:11:49 -08:00
2021-02-04 05:11:49 -08:00
2021-02-04 05:11:49 -08:00
2021-02-04 05:11:49 -08:00
2021-02-04 05:11:49 -08:00
2020-06-19 12:59:30 +09:30
2020-06-19 12:59:30 +09:30
2020-06-19 10:01:09 +09:30
2020-06-19 12:59:30 +09:30
2020-02-19 13:10:47 +10:30
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-02-26 03:58:47 -08:00
2020-08-16 05:45:02 -07:00
2020-08-16 05:45:02 -07:00
2021-02-26 17:49:04 +10:30
2021-02-26 17:49:04 +10:30
2021-02-26 17:49:04 +10:30
2021-02-26 17:49:04 +10:30
2024-04-08 05:18:24 -07:00
2024-04-08 05:18:24 -07:00
2024-04-08 05:18:24 -07:00
2024-04-08 05:18:24 -07:00
2024-04-08 05:18:24 -07:00
2024-07-09 01:37:35 -07:00
2024-07-09 01:37:35 -07:00
2025-05-14 15:09:40 +08:00
2025-05-14 15:09:40 +08:00
2025-05-14 15:09:40 +08:00
2025-05-14 15:09:40 +08:00
2025-05-14 15:09:40 +08:00
2025-05-14 15:09:40 +08:00