Fangrui Song
e07dfa5328
[MC][ELF] Improve st_size propagation rule
...
`.symver foo, foo@ver` creates the MCSymbolELF `foo@ver` whose almost all
attributes (including st_size) should inherit from `foo` (GNU as behavior).
a041ef1bd8905f0d58e301c6830b183002ff1847 added st_size propagation which works
for many cases but fails for the following one:
```
.set __GLIBC_2_12_sys_errlist, _sys_errlist_internal
.type __GLIBC_2_12_sys_errlist,@object
.size __GLIBC_2_12_sys_errlist, 1080
.symver __GLIBC_2_12_sys_errlist, sys_errlist@GLIBC_2.12
...
_sys_errlist_internal:
.size _sys_errlist_internal, 1072
```
`sys_errlist@GLIBC_2.12`'s st_size is 1072 (incorrect), which does not match
`__GLIBC_2_12_sys_errlist`'s st_size: 1080.
The problem is that `Base` is (the final) `_sys_errlist_internal` while we want
to respect (the intermediate) `__GLIBC_2_12_sys_errlist`'s st_size.
Fix this by following the MCSymbolRefExpr assignment chain and finding
the closest non-null `getSize()`, which covers most needs. Notably MCBinaryExpr
is not handled, but it is rare enough to matter.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D123283
2022-04-08 10:06:44 -07:00
..
2021-05-06 04:53:45 +05:30
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2021-03-06 16:26:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-07 15:47:10 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-12-20 18:37:14 -08:00
2020-07-20 10:39:04 +01:00
2022-01-27 00:37:49 -08:00
2020-07-20 10:39:04 +01:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2020-12-21 17:18:28 -08:00
2020-07-20 10:39:04 +01:00
2021-06-14 08:51:50 +05:30
2021-06-14 08:51:50 +05:30
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2020-10-05 15:34:33 -07:00
2021-09-02 01:00:51 -07:00
2021-03-06 16:20:55 -08:00
2021-09-02 01:00:51 -07:00
2020-12-21 17:18:28 -08:00
2020-12-21 17:18:28 -08:00
2021-02-25 22:29:49 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-09-02 01:00:51 -07:00
2022-03-22 16:46:48 +04:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-09-02 01:00:51 -07:00
2021-07-15 10:26:21 -07:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2022-03-14 22:33:08 -07:00
2022-01-21 13:52:10 +07:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2022-03-03 13:31:31 +02:00
2020-07-20 10:39:04 +01:00
2020-12-14 12:03:00 +03:00
2020-07-20 10:39:04 +01:00
2022-03-22 16:46:48 +04:00
2022-03-22 16:46:48 +04:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-12-21 17:18:28 -08:00
2021-02-13 10:32:27 -08:00
2020-12-14 12:03:00 +03:00
2020-07-20 10:39:04 +01:00
2021-08-27 08:53:55 -07:00
2022-03-28 13:40:48 -07:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-10-24 15:14:17 -07:00
2020-07-20 10:39:04 +01:00
2021-02-07 15:47:10 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-05-04 13:30:29 -07:00
2021-12-10 12:21:37 -08:00
2021-02-07 15:47:10 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2022-04-08 10:06:44 -07:00
2020-09-11 15:12:42 -07:00
2021-08-13 14:31:32 +02:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-07 15:47:10 -08:00
2020-12-20 18:37:14 -08:00
2021-02-13 10:32:27 -08:00
2021-09-02 01:00:51 -07:00
2020-11-18 13:52:33 -08:00
2021-09-02 01:00:51 -07:00
2020-12-11 16:45:45 +00:00
2022-02-23 15:43:12 +01:00
2020-08-03 13:43:48 -07:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-11-30 14:45:26 +00:00
2021-06-29 11:50:31 -07:00
2020-07-20 10:39:04 +01:00
2021-03-09 10:54:41 +00:00
2021-02-07 15:47:10 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-13 10:32:27 -08:00
2020-11-02 12:32:07 -08:00
2020-07-20 10:39:04 +01:00
2020-12-20 21:04:12 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-03-06 15:23:02 -08:00
2021-02-13 10:32:27 -08:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-07 15:47:10 -08:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00
2021-02-13 10:32:27 -08:00
2020-07-20 10:39:04 +01:00
2020-07-20 10:39:04 +01:00