Fangrui Song
c384ca3c6a
[ELF] For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths
...
For a relative path in INPUT() or GROUP(), this patch changes the search order by adding the directory of the current linker script.
The new search order (consistent with GNU ld >= 2.35 regarding the new test `test/ELF/input-relative.s`):
1. the directory of the current linker script (GNU ld from Binutils 2.35 onwards; https://sourceware.org/bugzilla/show_bug.cgi?id=25806 )
2. the current working directory
3. library paths (-L)
This behavior makes it convenient to replace a .so or .a with a linker script with additional input. For example, glibc
```
% cat /usr/lib/x86_64-linux-gnu/libm.a
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /usr/lib/x86_64-linux-gnu/libm-2.29.a /usr/lib/x86_64-linux-gnu/libmvec.a )
```
could be simplified as `GROUP(libm-2.29.a libmvec.a)`.
Another example is to make libc++.a a linker script:
```
INPUT(libc++.a.1 libc++abi.a)
```
Note, -l is not affected.
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D77779
2020-04-22 12:34:20 -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
2019-04-20 10:50:27 +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
2019-03-15 01:29:57 +00: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-02-12 08:20:14 -08: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
2019-04-26 06:59:30 +00: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-02-25 07:57:43 -08: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
2019-08-24 00:41:15 +00: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
2019-03-14 03:47:45 +00: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
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