blob: 020bd7d70cc680f19f8db330a966e2425096450d [file] [log] [blame]
Ryan Prichard80e40f02019-10-31 19:54:46 -07001// ========================================================
2// linker_wrapper - Linux Bionic (on the host)
3// ========================================================
Colin Cross97f0aef2016-07-14 16:05:46 -07004
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07005// This is used for bionic on (host) Linux to bootstrap our linker embedded into
6// a binary.
7//
8// Host bionic binaries do not have a PT_INTERP section, instead this gets
9// embedded as the entry point, and the linker is embedded as ELF sections in
10// each binary. There's a linker script that sets all of that up (generated by
11// extract_linker), and defines the extern symbols used in this file.
Bob Badouraa7d8352021-02-19 13:06:22 -080012package {
13 default_applicable_licenses: ["bionic_linker_license"],
14}
15
16license {
17 name: "bionic_linker_license",
18 visibility: [":__subpackages__"],
19 license_kinds: [
20 "SPDX-license-identifier-BSD",
21 ],
22 license_text: [
23 "NOTICE",
24 ],
25}
26
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070027cc_object {
28 name: "linker_wrapper",
29 host_supported: true,
30 device_supported: false,
Colin Crossda446cc2022-03-08 15:07:57 -080031 enabled: false,
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070032 target: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -080033 linux_bionic: {
34 enabled: true,
35 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070036 },
37
38 cflags: [
39 "-fno-stack-protector",
40 "-Wstrict-overflow=5",
41 "-fvisibility=hidden",
42 "-Wall",
43 "-Wextra",
44 "-Wno-unused",
45 "-Werror",
46 ],
47
48 srcs: [
49 "linker_wrapper.cpp",
50 ],
51 arch: {
Jiyong Park3b47d602020-09-18 16:15:53 +090052 arm64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070053 srcs: ["arch/arm64/linker_wrapper_begin.S"],
Jiyong Park3b47d602020-09-18 16:15:53 +090054 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +000055 riscv64: {
56 srcs: ["arch/riscv64/linker_wrapper_begin.S"],
57 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070058 x86_64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070059 srcs: ["arch/x86_64/linker_wrapper_begin.S"],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070060 },
61 },
62
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010063 header_libs: ["libc_headers"],
64
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070065 // We need to access Bionic private headers in the linker.
66 include_dirs: ["bionic/libc"],
67}
68
Ryan Prichard80e40f02019-10-31 19:54:46 -070069// ========================================================
70// linker default configuration
71// ========================================================
72
73// Configuration for the linker binary and any of its static libraries.
74cc_defaults {
75 name: "linker_defaults",
76 arch: {
77 arm: {
78 cflags: ["-D__work_around_b_24465209__"],
79 },
80 x86: {
81 cflags: ["-D__work_around_b_24465209__"],
82 },
83 },
84
85 cflags: [
86 "-fno-stack-protector",
87 "-Wstrict-overflow=5",
88 "-fvisibility=hidden",
89 "-Wall",
90 "-Wextra",
91 "-Wunused",
92 "-Werror",
93 ],
94
95 // TODO: split out the asflags.
96 asflags: [
97 "-fno-stack-protector",
98 "-Wstrict-overflow=5",
99 "-fvisibility=hidden",
100 "-Wall",
101 "-Wextra",
102 "-Wunused",
103 "-Werror",
104 ],
105
106 product_variables: {
107 debuggable: {
108 cppflags: ["-DUSE_LD_CONFIG_FILE"],
109 },
110 },
111
112 cppflags: ["-Wold-style-cast"],
113
114 static_libs: [
115 "libziparchive",
116 "libbase",
117 "libz",
118
119 "libasync_safe",
120
Jiyong Park7157dfb2022-08-19 13:09:18 +0900121 "liblog_for_runtime_apex",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700122 ],
123
124 // We need to access Bionic private headers in the linker.
125 include_dirs: ["bionic/libc"],
126}
127
128// ========================================================
129// linker components
130// ========================================================
131
132// Enable a module on all targets the linker runs on (ordinary Android targets, Linux Bionic, and
133// native bridge implementations).
134cc_defaults {
135 name: "linker_all_targets",
136 defaults: ["linux_bionic_supported"],
137 recovery_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700138 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700139 native_bridge_supported: true,
140}
141
142cc_library_static {
Ryan Prichard249757b2019-11-01 17:18:28 -0700143 name: "liblinker_main",
144 defaults: ["linker_defaults", "linker_all_targets"],
145 srcs: ["linker_main.cpp"],
146
147 // Ensure that the compiler won't insert string function calls before ifuncs are resolved.
148 cflags: ["-ffreestanding"],
149}
150
151cc_library_static {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700152 name: "liblinker_malloc",
153 defaults: ["linker_defaults", "linker_all_targets"],
154 srcs: ["linker_memory.cpp"],
155}
156
157cc_library_static {
158 name: "liblinker_debuggerd_stub",
159 defaults: ["linker_defaults", "linker_all_targets"],
160 srcs: ["linker_debuggerd_stub.cpp"],
161}
162
163// ========================================================
164// template for the linker binary
165// ========================================================
166
dimitryb8b3a762018-09-25 12:31:11 +0200167filegroup {
168 name: "linker_sources",
Colin Cross97f0aef2016-07-14 16:05:46 -0700169 srcs: [
170 "dlfcn.cpp",
171 "linker.cpp",
172 "linker_block_allocator.cpp",
Dimitry Ivanov769b33f2016-07-21 11:33:40 -0700173 "linker_dlwarning.cpp",
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700174 "linker_cfi.cpp",
Dimitry Ivanov4cabfaa2017-03-07 11:19:05 -0800175 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800176 "linker_debug.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700177 "linker_gdb_support.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700178 "linker_globals.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700179 "linker_libc_support.c",
Dimitry Ivanov451909d2017-01-26 16:52:59 -0800180 "linker_libcxx_support.cpp",
Dimitry Ivanovb943f302016-08-03 16:00:10 -0700181 "linker_namespaces.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700182 "linker_logger.cpp",
183 "linker_mapped_file_fragment.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100184 "linker_note_gnu_property.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700185 "linker_phdr.cpp",
Ryan Prichard339ecef2020-01-02 16:36:06 -0800186 "linker_relocate.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700187 "linker_sdk_versions.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700188 "linker_soinfo.cpp",
Collin Fijalkovich47d27aa2021-03-24 10:17:39 -0700189 "linker_transparent_hugepage_support.cpp",
Ryan Prichard45d13492019-01-03 02:51:30 -0800190 "linker_tls.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700191 "linker_utils.cpp",
192 "rt.cpp",
193 ],
dimitryb8b3a762018-09-25 12:31:11 +0200194}
Colin Cross97f0aef2016-07-14 16:05:46 -0700195
dimitryb8b3a762018-09-25 12:31:11 +0200196filegroup {
197 name: "linker_sources_arm",
198 srcs: [
199 "arch/arm/begin.S",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800200 "arch/arm_neon/linker_gnu_hash_neon.cpp",
dimitryb8b3a762018-09-25 12:31:11 +0200201 ],
202}
203
204filegroup {
205 name: "linker_sources_arm64",
206 srcs: [
207 "arch/arm64/begin.S",
Ryan Prichardffaae702019-01-23 17:47:10 -0800208 "arch/arm64/tlsdesc_resolver.S",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800209 "arch/arm_neon/linker_gnu_hash_neon.cpp",
dimitryb8b3a762018-09-25 12:31:11 +0200210 ],
211}
212
213filegroup {
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000214 name: "linker_sources_riscv64",
215 srcs: [
216 "arch/riscv64/begin.S",
217 ],
218}
219
220filegroup {
dimitryb8b3a762018-09-25 12:31:11 +0200221 name: "linker_sources_x86",
222 srcs: [
223 "arch/x86/begin.S",
224 ],
225}
226
227filegroup {
228 name: "linker_sources_x86_64",
229 srcs: [
230 "arch/x86_64/begin.S",
231 ],
232}
233
dimitryb8b3a762018-09-25 12:31:11 +0200234cc_defaults {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700235 name: "linker_version_script_overlay",
236 arch: {
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000237 arm: { version_script: "linker.arm.map" },
238 arm64: { version_script: "linker.generic.map" },
239 riscv64: { version_script: "linker.generic.map" },
240 x86: { version_script: "linker.generic.map" },
241 x86_64: { version_script: "linker.generic.map" },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700242 },
243}
244
245// A template for the linker binary. May be inherited by native bridge implementations.
246cc_defaults {
247 name: "linker_bin_template",
248 defaults: ["linker_defaults"],
249
250 srcs: [":linker_sources"],
251
Colin Cross97f0aef2016-07-14 16:05:46 -0700252 arch: {
253 arm: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700254 srcs: [":linker_sources_arm"],
Christopher Ferrisd37df2b2022-08-11 17:27:50 -0700255
256 // Arm 32 bit does not produce complete exidx unwind information
257 // so keep the .debug_frame which is relatively small and does
258 // include needed unwind information.
259 // See b/242162222 for details.
260 strip: {
261 keep_symbols_and_debug_frame: true,
262 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700263 },
264 arm64: {
265 srcs: [":linker_sources_arm64"],
Christopher Ferrisd37df2b2022-08-11 17:27:50 -0700266
267 // Leave the symbols in the shared library so that stack unwinders can produce
268 // meaningful name resolution.
269 strip: {
270 keep_symbols: true,
271 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700272 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000273 riscv64: {
274 srcs: [":linker_sources_riscv64"],
275
276 // Leave the symbols in the shared library so that stack unwinders can produce
277 // meaningful name resolution.
278 strip: {
279 keep_symbols: true,
280 },
281 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700282 x86: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700283 srcs: [":linker_sources_x86"],
Christopher Ferrisd37df2b2022-08-11 17:27:50 -0700284
285 // Leave the symbols in the shared library so that stack unwinders can produce
286 // meaningful name resolution.
287 strip: {
288 keep_symbols: true,
289 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700290 },
291 x86_64: {
292 srcs: [":linker_sources_x86_64"],
Christopher Ferrisd37df2b2022-08-11 17:27:50 -0700293
294 // Leave the symbols in the shared library so that stack unwinders can produce
295 // meaningful name resolution.
296 strip: {
297 keep_symbols: true,
298 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700299 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700300 },
301
Ryan Prichard80e40f02019-10-31 19:54:46 -0700302 // -shared is used to overwrite the -Bstatic and -static flags triggered by enabling
303 // static_executable. This dynamic linker is actually a shared object linked with static
304 // libraries.
Colin Cross97f0aef2016-07-14 16:05:46 -0700305 ldflags: [
306 "-shared",
307 "-Wl,-Bsymbolic",
308 "-Wl,--exclude-libs,ALL",
dimitry8e8c2c02018-01-04 12:08:32 +0100309 "-Wl,-soname,ld-android.so",
Colin Cross97f0aef2016-07-14 16:05:46 -0700310 ],
311
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -0800312 // we are going to link libc++_static manually because
313 // when stl is not set to "none" build system adds libdl
314 // to the list of static libraries which needs to be
315 // avoided in the case of building loader.
316 stl: "none",
317
Colin Cross97f0aef2016-07-14 16:05:46 -0700318 // we don't want crtbegin.o (because we have begin.o), so unset it
319 // just for this module
320 nocrt: true,
321
dimitryb8b3a762018-09-25 12:31:11 +0200322 static_executable: true,
323
dimitryb8b3a762018-09-25 12:31:11 +0200324 // Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb
325 // looking up symbols in the linker by mistake.
326 prefix_symbols: "__dl_",
327
328 sanitize: {
329 hwaddress: false,
330 },
dimitryb8b3a762018-09-25 12:31:11 +0200331
Colin Cross97f0aef2016-07-14 16:05:46 -0700332 static_libs: [
Ryan Prichard249757b2019-11-01 17:18:28 -0700333 "liblinker_main",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700334 "liblinker_malloc",
335
336 "libc++_static",
Colin Cross97f0aef2016-07-14 16:05:46 -0700337 "libc_nomalloc",
Ryan Prichard249757b2019-11-01 17:18:28 -0700338 "libc_dynamic_dispatch",
Dimitry Ivanov451909d2017-01-26 16:52:59 -0800339 "libm",
Ryan Prichardcdf71752020-12-16 03:37:22 -0800340 "libunwind",
Colin Cross97f0aef2016-07-14 16:05:46 -0700341 ],
Colin Cross97f0aef2016-07-14 16:05:46 -0700342
Ryan Prichardd9a41152019-10-14 16:58:53 -0700343 // Ensure that if the linker needs __gnu_Unwind_Find_exidx, then the linker will have a
344 // definition of the symbol. The linker links against libgcc.a, whose arm32 unwinder has a weak
345 // reference to __gnu_Unwind_Find_exidx, which isn't sufficient to pull in the strong definition
346 // of __gnu_Unwind_Find_exidx from libc. An unresolved weak reference would create a
347 // non-relative dynamic relocation in the linker binary, which complicates linker startup.
348 //
349 // This line should be unnecessary because the linker's dependency on libunwind_llvm.a should
350 // override libgcc.a, but this line provides a simpler guarantee. It can be removed once the
351 // linker stops linking against libgcc.a's arm32 unwinder.
352 whole_static_libs: ["libc_unwind_static"],
353
Ryan Prichard80e40f02019-10-31 19:54:46 -0700354 system_shared_libs: [],
355
356 // Opt out of native_coverage when opting out of system_shared_libs
357 native_coverage: false,
358}
359
360// ========================================================
361// linker[_asan][64] binary
362// ========================================================
363
364cc_binary {
Colin Cross97f0aef2016-07-14 16:05:46 -0700365 name: "linker",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700366 defaults: [
367 "linker_bin_template",
368 "linux_bionic_supported",
369 "linker_version_script_overlay",
370 ],
371
Victor Khimenkod15229d2020-05-14 22:14:45 +0200372 srcs: [
373 "linker_translate_path.cpp",
374 ],
375
Colin Cross10fffb42016-12-08 09:57:35 -0800376 symlinks: ["linker_asan"],
Florian Mayerc10d0642023-03-22 16:12:49 -0700377 arch: {
378 arm64: {
379 symlinks: ["linker_hwasan"],
380 },
381 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700382 multilib: {
Colin Cross97f0aef2016-07-14 16:05:46 -0700383 lib64: {
384 suffix: "64",
Colin Cross10fffb42016-12-08 09:57:35 -0800385 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700386 },
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800387
Ryan Prichard80e40f02019-10-31 19:54:46 -0700388 compile_multilib: "both",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700389
390 recovery_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700391 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700392 apex_available: [
393 "//apex_available:platform",
394 "com.android.runtime",
395 ],
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800396
Colin Cross97f0aef2016-07-14 16:05:46 -0700397 target: {
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800398 android: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700399 srcs: [
400 "linker_debuggerd_android.cpp",
401 ],
Dan Albert4ea19212019-07-23 13:31:14 -0700402 static_libs: [
403 "libc++demangle",
404 "libdebuggerd_handler_fallback",
405 ],
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800406 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700407 linux_bionic: {
408 static_libs: [
409 "liblinker_debuggerd_stub",
410 ],
Yi Kong6f6daaa2020-12-10 01:27:44 +0800411 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700412 },
Yi Konga7e363f2020-10-01 04:10:01 +0800413
Yi Konge20a1d92022-01-25 03:19:58 +0800414 afdo: true,
Colin Cross97f0aef2016-07-14 16:05:46 -0700415}
dimitry11da1dc2018-01-05 13:35:43 +0100416
Ryan Prichard80e40f02019-10-31 19:54:46 -0700417// ========================================================
418// assorted modules
419// ========================================================
420
Elliott Hughes90f96b92019-05-09 15:56:39 -0700421sh_binary {
422 name: "ldd",
Rupert Shuttlewortha7e29a82021-02-18 13:35:22 +0000423 src: "ldd.sh",
Elliott Hughes90f96b92019-05-09 15:56:39 -0700424}
425
Collin Fijalkovichc9521e02021-04-29 11:31:50 -0700426// Used to generate binaries that can be backed by transparent hugepages.
427cc_defaults {
428 name: "linker_hugepage_aligned",
429 arch: {
430 arm64: {
431 ldflags: ["-z max-page-size=0x200000"],
432 },
433 x86_64: {
434 ldflags: ["-z max-page-size=0x200000"],
435 },
436 },
437}
438
dimitry11da1dc2018-01-05 13:35:43 +0100439cc_library {
440 // NOTE: --exclude-libs=libgcc.a makes sure that any symbols ld-android.so pulls from
441 // libgcc.a are made static to ld-android.so. This in turn ensures that libraries that
442 // a) pull symbols from libgcc.a and b) depend on ld-android.so will not rely on ld-android.so
443 // to provide those symbols, but will instead pull them from libgcc.a. Specifically,
444 // we use this property to make sure libc.so has its own copy of the code from
445 // libgcc.a it uses.
446 //
447 // DO NOT REMOVE --exclude-libs!
448
Yi Kong7786a342018-08-31 19:01:56 -0700449 ldflags: [
450 "-Wl,--exclude-libs=libgcc.a",
Yi Kong7ac2afb2019-05-06 16:23:10 -0700451 "-Wl,--exclude-libs=libgcc_stripped.a",
Yi Kong7786a342018-08-31 19:01:56 -0700452 "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
453 "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000454 "-Wl,--exclude-libs=libclang_rt.builtins-riscv64-android.a",
Ryan Prichardef147872021-01-28 14:06:52 -0800455 "-Wl,--exclude-libs=libclang_rt.builtins-i686-android.a",
Yi Kong7786a342018-08-31 19:01:56 -0700456 "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
457 ],
dimitry11da1dc2018-01-05 13:35:43 +0100458
459 // for x86, exclude libgcc_eh.a for the same reasons as above
460 arch: {
461 x86: {
462 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
463 },
464 x86_64: {
465 ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
466 },
467 },
dimitry581723e2018-01-05 14:31:44 +0100468
469 srcs: ["ld_android.cpp"],
dimitry11da1dc2018-01-05 13:35:43 +0100470 cflags: [
471 "-Wall",
472 "-Wextra",
473 "-Wunused",
474 "-Werror",
475 ],
476 stl: "none",
477
478 name: "ld-android",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700479 defaults: ["linux_bionic_supported", "linker_version_script_overlay"],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800480 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700481 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +0900482 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200483 native_bridge_supported: true,
dimitry11da1dc2018-01-05 13:35:43 +0100484
Ryan Prichard470b6662018-03-27 22:10:55 -0700485 nocrt: true,
dimitry11da1dc2018-01-05 13:35:43 +0100486 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100487 header_libs: ["libc_headers"],
dimitry11da1dc2018-01-05 13:35:43 +0100488
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800489 // Opt out of native_coverage when opting out of system_shared_libs
490 native_coverage: false,
491
dimitry11da1dc2018-01-05 13:35:43 +0100492 sanitize: {
493 never: true,
494 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900495
496 apex_available: [
497 "//apex_available:platform",
498 "com.android.runtime",
499 ],
Yi Kong15a05a72020-09-22 00:56:13 +0800500
501 lto: {
502 never: true,
503 },
dimitry11da1dc2018-01-05 13:35:43 +0100504}
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800505
506cc_test {
507 name: "linker-unit-tests",
Colin Cross0cc60af2021-09-30 14:04:39 -0700508 test_suites: ["device-tests"],
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800509
510 cflags: [
511 "-g",
512 "-Wall",
513 "-Wextra",
514 "-Wunused",
515 "-Werror",
516 ],
517
518 // We need to access Bionic private headers in the linker.
519 include_dirs: ["bionic/libc"],
520
521 srcs: [
522 // Tests.
523 "linker_block_allocator_test.cpp",
524 "linker_config_test.cpp",
525 "linked_list_test.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100526 "linker_note_gnu_property_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800527 "linker_sleb128_test.cpp",
528 "linker_utils_test.cpp",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800529 "linker_gnu_hash_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800530
531 // Parts of the linker that we're testing.
532 "linker_block_allocator.cpp",
533 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800534 "linker_debug.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100535 "linker_note_gnu_property.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800536 "linker_test_globals.cpp",
537 "linker_utils.cpp",
538 ],
539
540 static_libs: [
541 "libasync_safe",
542 "libbase",
Jiyong Park7157dfb2022-08-19 13:09:18 +0900543 "liblog_for_runtime_apex",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800544 ],
Ryan Prichard129f7a12019-12-23 16:45:47 -0800545
546 arch: {
547 arm: {
548 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
549 },
550 arm64: {
551 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
552 },
553 },
554}
555
556cc_benchmark {
557 name: "linker-benchmarks",
558
559 srcs: [
560 "linker_gnu_hash_benchmark.cpp",
561 ],
562
563 arch: {
564 arm: {
565 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
566 },
567 arm64: {
568 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
569 },
570 },
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800571}