Fangrui Song
c49f83b6e9
[ELF] Don't advance sh_offset for an empty section whose PT_LOAD is removed (due to p_memsz=0)
removeEmptyPTLoad() removes empty (p_memsz=0) PT_LOAD segments. In
assignFileOffsets(), setFileOffset() unnecessarily advances file offsets
for containing empty sections.
This is exposed by arm Linux kernel's multi_v5_defconfig
(see https://bugs.llvm.org/show_bug.cgi?id=45632)
```
ld.lld (max-page-size=65536):
[34] .init.data PROGBITS c0c24000 c34000 0128ac 00 WA 0 0 4096
[35] .text_itcm PROGBITS fffe0000 c50000 000000 00 WA 0 0 1
[36] .data_dtcm PROGBITS fffe8000 c58000 000000 00 WA 0 0 1
[37] .data PROGBITS c0c38000 c58000 0647a0 00 WA 0 0 32
arm-linux-gnueabi-ld (max-page-size=65536):
[23] .init.data PROGBITS c0c12000 c22000 0128ac 00 WA 0 0 4096
[24] .text_itcm PROGBITS fffe0000 ca2558 000000 00 W 0 0 1
[25] .data_dtcm PROGBITS fffe8000 ca2558 000000 00 W 0 0 1
[26] .data PROGBITS c0c26000 c36000 0647a0 00 WA 0 0 32
```
This patch clears OutputSection::ptLoad if ptLoad is removed by
removeEmptyPTLoad(). Conceptually this removes "dangling" references.
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D79254
2020-05-04 08:07:34 -07:00
..
2020-02-19 22:01:42 -08:00
2020-03-05 09:59:53 -08:00
2020-03-19 19:11:11 -07:00
2019-09-16 07:05:34 +00:00
2020-03-15 17:48:36 -07:00
2020-02-12 21:54:50 -08:00
2020-04-02 01:21:36 +09:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-05 09:59:53 -08:00
2020-03-05 09:59:53 -08:00
2020-03-19 19:11:11 -07:00
2020-03-04 10:48:36 -08:00
2019-05-01 05:49:01 +00:00
2019-09-24 21:44:14 +00:00
2019-09-24 21:44:14 +00:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2020-01-06 10:25:48 -08:00
2020-03-15 17:48:36 -07:00
2020-02-12 21:54:50 -08:00
2020-05-04 08:07:34 -07:00
2019-05-01 05:49:01 +00:00
2020-03-19 19:11:11 -07:00
2020-02-12 21:54:50 -08:00
2019-05-16 23:33:06 +00:00
2020-03-19 18:04:47 -07:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2020-02-19 22:01:42 -08:00
2020-02-19 22:01:42 -08:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2020-03-23 10:30:06 -07:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-03-15 17:48:36 -07:00
2019-12-26 09:54:22 -08:00
2019-11-19 08:54:06 -08:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2019-06-03 05:34:25 +00:00
2020-02-12 21:54:50 -08:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-19 18:04:47 -07:00
2019-05-01 05:49:01 +00:00
2019-09-26 17:10:09 +00:00
2020-03-04 10:48:36 -08:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-17 12:58:24 -07:00
2020-02-12 21:54:50 -08:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2020-02-26 10:32:54 -08:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2019-06-28 10:14:14 +00:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2020-05-04 08:07:34 -07:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2020-02-12 21:54:50 -08:00
2020-03-05 18:05:28 -08:00
2020-02-12 21:54:50 -08:00
2020-03-04 10:48:36 -08:00
2020-03-19 19:11:11 -07:00
2020-03-19 19:11:11 -07:00
2020-03-19 19:11:11 -07:00
2020-01-22 12:03:10 +00:00
2019-07-10 14:36:48 +00:00
2020-02-12 21:54:50 -08:00
2019-05-01 05:49:01 +00:00
2019-05-01 06:02:16 +00:00
2020-02-12 21:54:50 -08:00
2020-03-23 10:30:06 -07:00
2020-02-12 21:54:50 -08:00
2020-04-30 20:14:22 +01:00
2020-03-15 17:48:36 -07:00
2020-04-22 12:34:20 -07:00
2020-03-15 17:48:36 -07:00
2020-02-12 08:21:52 -08:00
2020-02-12 08:21:52 -08:00
2020-02-12 21:54:50 -08:00
2020-02-12 08:21:52 -08:00
2020-02-12 21:54:50 -08:00
2019-05-01 05:49:01 +00:00
2020-03-16 07:42:04 -07:00
2020-02-12 21:54:50 -08:00
2020-03-23 10:30:06 -07:00
2020-03-30 15:17:29 -07:00
2020-03-30 10:03:55 -07:00
2020-03-11 09:35:42 -07:00
2020-04-01 08:19:06 -07:00
2020-02-12 21:54:50 -08:00
2020-04-01 08:19:06 -07:00
2020-03-15 17:48:36 -07:00
2020-02-12 21:54:50 -08:00
2020-04-01 08:19:06 -07:00
2020-03-23 10:30:06 -07:00
2020-02-08 22:45:00 -08:00
2020-02-12 21:54:50 -08:00
2020-03-09 08:31:41 -07:00
2019-08-09 01:25:49 +00:00
2020-03-06 14:01:20 -08:00
2020-03-06 14:01:20 -08:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-09 08:31:41 -07:00
2020-03-19 19:11:11 -07:00
2020-03-15 17:48:36 -07:00
2019-09-24 11:48:31 +00:00
2020-03-19 19:11:11 -07:00
2020-03-19 19:11:11 -07:00
2020-03-15 17:48:36 -07:00
2019-05-01 06:02:16 +00:00
2019-05-13 16:01:26 +00:00
2020-05-04 08:07:34 -07:00
2020-03-28 10:07:58 -07:00
2020-03-04 10:48:36 -08:00
2020-03-05 18:05:28 -08:00
2020-03-19 19:11:11 -07:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2020-03-04 10:48:36 -08:00
2020-03-19 19:11:11 -07:00
2019-05-01 05:49:01 +00:00
2019-04-30 12:27:06 +00:00
2019-04-23 12:38:52 +00:00
2020-03-23 10:30:06 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-12 08:00:18 -07:00
2020-02-21 08:12:00 -08:00
2020-03-19 19:11:11 -07:00
2020-02-12 21:54:50 -08:00
2020-02-12 21:54:50 -08:00
2020-04-01 08:19:06 -07:00
2019-05-01 05:49:01 +00:00
2020-03-04 10:48:36 -08:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2020-03-26 15:30:24 +00:00
2019-05-01 05:49:01 +00:00
2020-03-04 10:48:36 -08:00
2019-05-01 05:49:01 +00:00
2019-04-22 07:57:07 +00:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-03-19 19:11:11 -07:00
2020-03-15 17:48:36 -07:00
2020-03-19 19:11:11 -07:00
2020-03-11 09:35:42 -07:00
2020-03-11 09:35:42 -07:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-19 19:11:11 -07:00
2020-03-19 12:49:25 +03:00
2020-03-15 17:48:36 -07:00
2020-03-04 10:48:36 -08:00
2020-03-19 19:11:11 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-04-02 01:21:36 +09:00
2019-05-01 05:49:01 +00:00
2020-03-23 10:30:06 -07:00
2019-08-26 10:23:31 +00:00
2019-08-26 10:23:31 +00:00
2020-03-04 10:48:36 -08:00
2019-05-31 08:20:43 +00:00
2020-03-04 10:48:36 -08:00
2020-03-04 12:22:12 -08:00
2019-05-01 05:49:01 +00:00
2020-03-15 17:48:36 -07:00
2019-05-02 00:39:03 +00:00
2020-03-05 09:59:53 -08:00
2020-03-05 09:59:53 -08:00
2020-03-15 17:48:36 -07:00
2020-03-05 09:59:53 -08:00
2020-03-19 19:11:11 -07:00
2020-03-05 09:59:53 -08:00
2020-03-05 09:59:53 -08:00
2019-05-01 05:49:01 +00:00
2020-05-02 22:49:23 +01:00
2019-05-01 06:02:16 +00:00
2020-03-04 10:48:36 -08:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00
2019-05-01 05:49:01 +00:00
2020-02-12 21:54:50 -08:00
2019-06-11 12:59:30 +00:00
2020-03-15 17:48:36 -07:00
2020-03-15 17:48:36 -07:00