Fangrui Song
7b346357db
[ELF] Orphan placement: prefer the last similar section when its rank <= orphan's rank
...
`findOrphanPos` finds the most similar output section (that has input
sections). In the event of proximity ties, we select the first section.
However, when an orphan section's rank is equal to or larger than the
most similar sections's, it makes sense to prioritize the last similar
section. This new behavior matches GNU ld better.
```
// orphan placement for .bss (SHF_ALLOC|SHF_WRITE, SHT_NOBITS)
WA SHT_PROGBITS
(old behavior) <= here
A
WA SHT_PROGBITS
AX
WA (.data)
(new behavior) <= here
```
When the orphan section's rank is less, the current behavior
prioritizing the first section still makes sense.
```
// orphan with a smaller rank, e.g. .rodata
<= here
WA
AX
WA
```
Close #92987
Pull Request: https://github.com/llvm/llvm-project/pull/94099
2024-06-04 09:14:54 -07:00
..
2024-05-31 11:52:57 -07:00
2024-04-18 14:41:14 -07:00
2024-06-04 09:14:54 -07:00
2024-05-06 21:37:07 +08:00
2024-04-04 12:38:09 +03:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-09-11 21:01:36 -07:00
2024-05-21 17:34:17 +01:00
2024-04-04 12:38:09 +03:00
2024-05-31 14:57:58 +03:00
2024-03-23 01:02:08 -07:00
2024-03-24 14:07:09 -07:00
2023-07-27 20:51:42 -07:00
2024-01-08 11:22:38 +01:00
2023-10-10 17:32:10 +02:00
2023-07-27 20:51:42 -07:00
2024-01-10 15:12:42 -08:00
2024-04-11 09:36:56 +01:00
2024-04-04 12:38:09 +03:00
2024-05-16 10:04:58 +03:00
2023-07-27 20:51:42 -07:00
2024-05-12 21:15:36 -07:00
2024-03-19 10:44:36 -07:00
2024-03-27 14:08:59 -07:00
2024-03-29 23:36:50 -07:00
2023-09-21 12:00:45 +02:00
2023-11-07 12:35:17 +01:00
2024-03-06 22:50:37 -08:00
2023-09-21 12:00:45 +02:00
2023-09-21 12:00:45 +02:00
2023-09-15 22:59:08 -07:00
2024-02-05 08:19:53 +01:00
2024-01-11 16:49:14 +00:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-09-14 10:33:11 -07:00
2024-05-15 15:41:20 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2024-03-24 14:07:09 -07:00
2023-07-27 20:51:42 -07:00
2024-05-27 11:21:12 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2024-02-13 18:31:32 -05:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2023-07-27 20:51:42 -07:00
2024-05-29 13:28:32 -07:00
2024-05-23 09:18:32 +08:00
2024-05-23 09:18:32 +08:00
2023-09-11 21:01:36 -07:00
2024-02-13 11:29:21 +01:00
2023-08-21 09:11:51 -07:00
2023-07-19 11:37:42 -07:00
2023-10-10 09:06:31 -07:00
2023-10-10 09:06:31 -07:00
2023-09-25 09:49:40 -07:00
2023-10-10 09:06:31 -07:00
2023-10-10 09:06:31 -07:00
2023-10-10 09:06:31 -07:00
2023-11-08 12:34:36 -08:00
2023-11-03 16:03:06 -07:00
2023-07-19 08:34:26 -07:00
2024-01-23 11:38:15 -08:00
2024-03-27 20:01:30 -07:00
2024-01-21 18:15:57 -08:00
2023-09-11 00:26:22 -07:00
2024-05-22 15:55:21 -07:00
2024-03-12 10:56:14 -07:00
2024-05-22 15:40:24 -07:00
2024-05-22 15:55:21 -07:00
2023-07-19 08:34:26 -07:00
2024-05-23 23:12:25 -07:00
2024-01-22 09:09:46 -08:00
2024-01-24 08:53:36 -08:00
2023-12-21 18:59:11 -08:00
2023-12-21 18:59:11 -08:00
2024-04-18 16:39:54 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2024-04-18 14:41:14 -07:00
2023-11-06 12:05:13 -08:00
2024-05-03 09:26:05 -07:00
2023-09-11 21:01:36 -07:00
2023-10-03 10:20:14 +01:00
2023-10-03 10:20:14 +01:00
2023-10-03 10:20:14 +01:00
2024-01-07 16:02:52 -08:00
2023-10-03 10:20:14 +01:00
2024-02-20 12:53:40 -08:00
2023-12-08 18:09:45 +05:30
2024-05-16 17:52:08 +08:00
2024-02-13 11:29:21 +01:00
2023-09-14 10:33:11 -07:00
2024-03-27 20:01:30 -07:00
2023-07-21 08:10:52 -04:00
2023-09-16 00:41:23 -07:00
2023-07-19 08:34:26 -07:00
2023-10-18 08:56:17 -07:00
2024-03-25 16:11:21 -07:00
2024-03-23 01:02:08 -07:00
2024-03-24 14:07:09 -07:00
2024-04-02 19:34:14 -07:00
2023-12-12 10:14:36 -08:00
2023-12-12 10:14:36 -08:00
2023-12-07 12:43:40 -08:00
2024-03-06 22:50:37 -08:00
2023-07-19 11:28:47 -07:00
2023-07-18 17:57:31 -07:00
2023-07-18 17:57:31 -07:00
2024-03-15 09:50:23 -07:00
2024-01-09 10:59:48 -08:00
2023-07-25 17:06:07 +08:00
2023-11-15 09:57:45 +08:00
2023-07-25 17:06:07 +08:00
2023-12-25 22:48:56 +08:00
2023-07-25 17:06:07 +08:00
2024-01-10 18:03:52 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-08-09 09:55:27 +08:00
2023-07-25 17:06:07 +08:00
2024-02-06 09:09:13 +08:00
2024-06-04 09:00:14 +08:00
2024-03-05 22:09:01 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-07-25 17:06:07 +08:00
2023-09-14 10:33:11 -07:00
2023-09-14 10:33:11 -07:00
2023-07-19 11:28:47 -07:00
2023-07-19 11:28:47 -07:00
2023-07-19 11:28:47 -07:00
2023-07-19 11:28:47 -07:00
2024-05-20 00:13:09 -07:00
2024-05-12 21:15:36 -07:00
2024-02-24 15:13:43 +08:00
2024-05-15 15:41:20 -07:00
2023-12-07 12:43:40 -08:00
2023-11-15 23:42:59 -08:00
2024-03-18 14:42:45 -07:00
2024-03-27 09:47:16 -07:00
2024-04-19 09:51:29 -07:00
2023-09-14 10:33:11 -07:00
2024-04-19 09:21:57 -07:00
2023-09-14 10:33:11 -07:00
2024-04-18 14:41:14 -07:00
2024-03-23 01:02:08 -07:00
2023-12-13 12:55:47 -06:00
2024-05-15 15:41:20 -07:00
2023-08-31 08:45:10 -05:00
2023-09-15 22:38:18 -07:00
2023-09-15 22:38:18 -07:00
2024-05-15 15:41:20 -07:00
2023-09-14 10:33:11 -07:00
2023-08-31 08:45:10 -05:00
2023-08-31 08:45:10 -05:00
2024-05-15 15:41:20 -07:00
2023-09-11 00:26:22 -07:00
2023-07-18 17:57:31 -07:00
2023-09-19 23:44:55 -07:00
2023-09-19 23:44:55 -07:00
2023-09-20 14:50:13 -07:00
2023-09-14 10:33:11 -07:00
2023-09-14 10:33:11 -07:00
2023-09-14 10:33:11 -07:00
2024-03-27 20:01:30 -07:00
2023-09-14 10:33:11 -07:00
2023-08-08 20:25:10 -07:00
2024-04-19 09:09:41 -07:00
2024-01-10 15:16:55 -08:00
2024-04-26 12:16:53 +01:00
2024-04-26 11:27:28 -07:00
2024-04-26 11:27:28 -07:00
2024-05-15 15:41:20 -07:00
2024-04-26 11:27:28 -07:00
2024-03-23 01:02:08 -07:00
2024-04-26 11:27:28 -07:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-01 11:02:53 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2024-01-08 20:24:00 -08:00
2024-02-09 12:01:49 -08:00
2024-05-03 23:59:30 -07:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2023-12-14 22:42:11 -08:00
2024-01-25 13:42:31 -08:00
2024-03-22 12:27:41 -07:00
2024-03-22 12:27:41 -07:00
2024-03-27 20:01:30 -07:00
2023-07-28 11:13:03 +02:00
2023-09-14 10:33:11 -07:00
2024-02-09 10:38:03 -08:00
2023-09-14 10:33:11 -07:00
2023-11-10 23:04:45 -08:00
2024-03-29 23:36:50 -07:00
2023-09-14 10:33:11 -07:00
2023-09-14 10:33:11 -07:00
2023-09-14 10:33:11 -07:00
2023-11-04 10:19:14 -07:00
2023-09-11 00:26:22 -07:00
2024-02-13 11:29:21 +01:00
2024-03-06 22:50:37 -08:00
2024-03-06 22:50:37 -08:00
2024-03-06 22:50:37 -08:00
2024-03-24 14:07:09 -07:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2024-02-14 18:26:38 +01:00
2024-02-13 11:29:21 +01:00
2024-02-13 11:29:21 +01:00
2023-09-11 00:26:22 -07:00
2024-05-12 21:15:36 -07:00
2023-11-03 13:53:36 -07:00
2023-08-08 20:25:10 -07:00
2024-03-15 09:50:23 -07:00
2024-02-27 13:01:25 -05:00
2024-02-12 17:37:29 -08:00
2023-08-08 20:25:10 -07:00
2023-09-09 23:47:01 -07:00
2023-11-03 20:40:46 -07:00
2024-01-29 13:26:33 -08:00
2024-03-06 23:19:59 -08:00
2024-03-27 20:04:59 -07:00
2024-02-27 13:01:25 -05:00
2024-03-27 20:01:30 -07:00
2024-01-22 09:09:46 -08:00
2024-03-06 22:50:37 -08:00
2024-03-24 11:43:15 -06:00
2024-03-06 22:50:37 -08:00
2024-03-06 22:50:37 -08:00
2024-01-17 15:38:59 -08:00
2024-03-06 22:50:37 -08:00
2024-03-06 22:50:37 -08:00
2023-12-11 12:32:13 -08:00
2024-02-20 13:59:49 -08:00
2024-01-07 11:59:49 -08:00
2024-01-22 18:18:21 -08:00