Fangrui Song
20de182246
[llvm-objcopy] --only-keep-debug: place zero-size segment according to its parent segment
...
Alternative to D74755. sectionWithinSegment() treats an empty section as having
a size of 1. Due to the rule, an empty .tdata will not be attributed to an
empty PT_TLS. (The empty p_align=64 PT_TLS is for Android Bionic's TCB
compatibility (ELF-TLS). See https://reviews.llvm.org/D62055#1507426 )
Currently --only-keep-debug will not layout a segment with no section
(layoutSegmentsForOnlyKeepDebug()), thus p_offset of PT_TLS can go past the end
of the file. The strange p_offset can trigger validation errors for subsequent
tools, e.g. llvm-objcopy errors when reading back the separate debug file
(readProgramHeaders()).
This patch places such an empty segment according to its parent segment. This
special cases works for the empty PT_TLS used in Android. For a non-empty
segment, it should have at least one non-empty section and will be handled by
the normal code. Note, p_memsz PT_LOAD is rejected by both Linux and FreeBSD.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D90897
2020-11-11 09:21:10 -08:00
..
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-03-05 09:53:14 -08:00
2020-11-04 09:39:14 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-04 09:39:14 -08:00
2020-02-19 15:09:19 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-04-06 17:22:56 -05:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-06-24 19:56:01 -05:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-04-19 20:10:05 -07:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-06-05 10:45:51 -07:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-06-29 10:42:03 +01:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-04-20 21:18:48 -07:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-03-16 07:42:04 -07:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-11 09:21:10 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-30 17:56:12 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-03-04 12:22:12 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-04-17 12:35:25 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-05-29 20:24:53 +07:00
2020-05-29 20:24:53 +07:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-04-15 13:09:51 +03:00
2020-01-21 17:20:18 -08:00
2020-04-06 14:47:05 +01:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-04-20 21:18:48 -07:00
2020-05-19 12:59:13 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-08-10 16:03:14 -04:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-07-28 13:26:33 -07:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-30 17:56:12 -08:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-11-09 13:00:50 +03:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00
2020-01-21 17:20:18 -08:00