mykouHW
507f394d03
[ELF] -r/--emit-relocs: Fix crash when processing .rela.text before .text ( #156354 )
...
fixes #156417
When the relocation section is placed before the relocated section and
the relocated section is not defined in the linker script, an error will
occur during the linking process.
**Issue Cause:**
In a.ro, `.rela.text` precedes its relocated `InputSection` `.text`.
`addOrphanSections` doesn't handle this scenario.
When it processes `.rela.text`, in the called `getOutputSectionName`,
`rel->getOutputSection()` is nullptr (input `.text` doesn't yet have a
parent output section), leading to an assertion failure.
**Solution:**
For --emit-relocs and -r, ensure the output section for `.text.foo` is
created before the output section for `.rela.text.foo`.
---------
Co-authored-by: Fangrui Song <i@maskray.me>
2025-09-20 16:41:54 +00:00
..
2023-11-01 09:29:33 -07:00
2024-06-24 10:15:28 -07:00
2025-07-06 10:22:50 -07:00
2024-07-27 16:39:15 -07:00
2024-07-27 16:39:15 -07:00
2025-05-16 23:57:44 -07:00
2024-05-22 15:40:24 -07:00
2024-05-22 15:40:24 -07:00
2023-12-16 13:12:17 -08:00
2024-07-20 14:13:02 -07:00
2023-09-14 14:47:20 -07:00
2023-09-14 10:33:11 -07:00
2024-04-19 09:09:41 -07:00
2023-09-11 10:54:49 -07:00
2025-01-21 20:05:07 -08:00
2025-01-02 18:46:44 -08:00
2025-02-19 09:15:26 -08:00
2023-11-17 22:38:15 -08:00
2023-11-17 22:38:15 -08:00
2024-07-02 10:58:24 -07:00
2024-07-02 10:58:24 -07:00
2023-11-01 22:35:28 -07:00
2024-05-13 11:06:54 -07:00
2024-05-13 11:06:54 -07:00
2023-06-14 15:26:31 -07:00
2023-11-01 09:29:33 -07:00
2023-11-01 22:35:28 -07:00
2023-11-01 09:29:33 -07:00
2025-01-10 19:30:38 -08:00
2024-07-28 11:43:27 -07:00
2024-11-29 18:37:47 -08:00
2024-07-27 17:25:13 -07:00
2025-02-19 09:15:26 -08:00
2024-07-27 17:34:37 -07:00
2024-07-27 17:34:37 -07:00
2025-09-03 09:12:12 -07:00
2023-11-01 22:35:28 -07:00
2025-03-01 20:55:17 -08:00
2025-05-28 20:56:13 -07:00
2023-09-20 09:06:45 -07:00
2024-07-26 14:26:38 -07:00
2024-07-26 14:26:38 -07:00
2024-07-26 16:51:42 -07:00
2025-05-16 23:57:44 -07:00
2024-06-06 12:13:19 -07:00
2023-07-19 11:28:47 -07:00
2025-04-02 09:25:18 -07:00
2023-05-23 20:41:20 +00:00
2025-01-21 20:05:07 -08:00
2024-05-12 21:15:36 -07:00
2025-09-20 16:41:54 +00:00
2024-05-29 14:53:29 -07:00
2024-06-04 09:14:54 -07:00
2025-05-21 09:19:47 -07:00
2024-07-27 16:52:47 -07:00
2025-03-11 19:58:14 +01:00
2025-04-02 09:25:18 -07:00
2024-08-12 11:56:29 -07:00
2024-07-27 17:40:51 -07:00
2023-05-25 13:05:43 -07:00
2024-10-15 09:20:10 -07:00
2023-12-12 22:29:36 -08:00
2024-07-27 16:29:43 -07:00
2025-03-01 20:55:17 -08:00
2025-05-21 09:19:47 -07:00
2025-03-11 15:01:18 -07:00
2024-05-31 09:31:15 -07:00
2023-07-05 14:56:16 -07:00
2024-07-02 10:58:24 -07:00
2024-11-29 18:37:47 -08:00
2024-06-06 13:22:47 -07:00
2023-12-16 13:12:17 -08:00
2024-07-27 14:46:41 -07:00
2025-02-26 09:10:53 -08:00
2023-12-16 13:12:17 -08:00
2024-11-24 11:22:19 -08:00
2024-01-22 09:09:46 -08:00
2024-07-27 16:19:57 -07:00
2024-07-26 14:26:38 -07:00
2024-03-06 17:19:59 -08:00