blob: 694d1f5a202f4f4f1b74d2daee16ee73581c0b74 [file] [log] [blame]
Bob Badouraa7d8352021-02-19 13:06:22 -08001package {
Aditya Choudharyd9d37c02024-02-02 13:57:12 +00002 default_team: "trendy_team_native_tools_libraries",
Bob Badouraa7d8352021-02-19 13:06:22 -08003 default_applicable_licenses: ["bionic_linker_license"],
4}
5
6license {
7 name: "bionic_linker_license",
8 visibility: [":__subpackages__"],
9 license_kinds: [
10 "SPDX-license-identifier-BSD",
11 ],
12 license_text: [
13 "NOTICE",
14 ],
15}
16
Elliott Hughes4b5d62e2024-06-20 16:21:08 +000017// ========================================================
18// linker_wrapper - Linux Bionic (on the host)
19// ========================================================
20
21// This is used for bionic on (host) Linux to bootstrap our linker embedded into
22// a binary.
23//
24// Host bionic binaries do not have a PT_INTERP section, instead this gets
25// embedded as the entry point, and the linker is embedded as ELF sections in
26// each binary. There's a linker script that sets all of that up (generated by
27// extract_linker), and defines the extern symbols used in this file.
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070028cc_object {
29 name: "linker_wrapper",
30 host_supported: true,
31 device_supported: false,
Colin Crossda446cc2022-03-08 15:07:57 -080032 enabled: false,
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070033 target: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -080034 linux_bionic: {
35 enabled: true,
36 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070037 },
38
39 cflags: [
40 "-fno-stack-protector",
41 "-Wstrict-overflow=5",
42 "-fvisibility=hidden",
43 "-Wall",
44 "-Wextra",
45 "-Wno-unused",
46 "-Werror",
47 ],
48
49 srcs: [
50 "linker_wrapper.cpp",
51 ],
52 arch: {
Jiyong Park3b47d602020-09-18 16:15:53 +090053 arm64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070054 srcs: ["arch/arm64/linker_wrapper_begin.S"],
Jiyong Park3b47d602020-09-18 16:15:53 +090055 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +000056 riscv64: {
57 srcs: ["arch/riscv64/linker_wrapper_begin.S"],
58 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070059 x86_64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070060 srcs: ["arch/x86_64/linker_wrapper_begin.S"],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070061 },
62 },
63
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010064 header_libs: ["libc_headers"],
65
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070066 // We need to access Bionic private headers in the linker.
67 include_dirs: ["bionic/libc"],
68}
69
Ryan Prichard80e40f02019-10-31 19:54:46 -070070// ========================================================
71// linker default configuration
72// ========================================================
73
74// Configuration for the linker binary and any of its static libraries.
75cc_defaults {
76 name: "linker_defaults",
77 arch: {
78 arm: {
79 cflags: ["-D__work_around_b_24465209__"],
80 },
81 x86: {
82 cflags: ["-D__work_around_b_24465209__"],
83 },
84 },
85
86 cflags: [
87 "-fno-stack-protector",
88 "-Wstrict-overflow=5",
89 "-fvisibility=hidden",
90 "-Wall",
91 "-Wextra",
92 "-Wunused",
93 "-Werror",
94 ],
95
96 // TODO: split out the asflags.
97 asflags: [
98 "-fno-stack-protector",
99 "-Wstrict-overflow=5",
100 "-fvisibility=hidden",
101 "-Wall",
102 "-Wextra",
103 "-Wunused",
104 "-Werror",
105 ],
106
107 product_variables: {
108 debuggable: {
109 cppflags: ["-DUSE_LD_CONFIG_FILE"],
110 },
111 },
112
113 cppflags: ["-Wold-style-cast"],
114
115 static_libs: [
116 "libziparchive",
117 "libbase",
118 "libz",
119
120 "libasync_safe",
121
Jiyong Park7157dfb2022-08-19 13:09:18 +0900122 "liblog_for_runtime_apex",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700123 ],
124
125 // We need to access Bionic private headers in the linker.
126 include_dirs: ["bionic/libc"],
127}
128
129// ========================================================
130// linker components
131// ========================================================
132
133// Enable a module on all targets the linker runs on (ordinary Android targets, Linux Bionic, and
134// native bridge implementations).
135cc_defaults {
136 name: "linker_all_targets",
137 defaults: ["linux_bionic_supported"],
138 recovery_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700139 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700140 native_bridge_supported: true,
141}
142
143cc_library_static {
Ryan Prichard249757b2019-11-01 17:18:28 -0700144 name: "liblinker_main",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000145 defaults: [
146 "linker_defaults",
147 "linker_all_targets",
148 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700149 srcs: ["linker_main.cpp"],
150
151 // Ensure that the compiler won't insert string function calls before ifuncs are resolved.
152 cflags: ["-ffreestanding"],
Spandan Das0a6cfe92024-01-04 18:06:50 +0000153 apex_available: [
154 "com.android.runtime",
155 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700156}
157
158cc_library_static {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700159 name: "liblinker_malloc",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000160 defaults: [
161 "linker_defaults",
162 "linker_all_targets",
163 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700164 srcs: ["linker_memory.cpp"],
Spandan Das0a6cfe92024-01-04 18:06:50 +0000165 apex_available: [
166 "com.android.runtime",
167 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700168}
169
170cc_library_static {
171 name: "liblinker_debuggerd_stub",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000172 defaults: [
173 "linker_defaults",
174 "linker_all_targets",
175 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700176 srcs: ["linker_debuggerd_stub.cpp"],
177}
178
179// ========================================================
180// template for the linker binary
181// ========================================================
182
dimitryb8b3a762018-09-25 12:31:11 +0200183filegroup {
184 name: "linker_sources",
Colin Cross97f0aef2016-07-14 16:05:46 -0700185 srcs: [
186 "dlfcn.cpp",
187 "linker.cpp",
Elliott Hughes838dbac2023-08-22 14:07:48 -0700188 "linker_auxv.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700189 "linker_block_allocator.cpp",
Dimitry Ivanov769b33f2016-07-21 11:33:40 -0700190 "linker_dlwarning.cpp",
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700191 "linker_cfi.cpp",
Dimitry Ivanov4cabfaa2017-03-07 11:19:05 -0800192 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800193 "linker_debug.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700194 "linker_gdb_support.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700195 "linker_globals.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700196 "linker_libc_support.c",
Dimitry Ivanov451909d2017-01-26 16:52:59 -0800197 "linker_libcxx_support.cpp",
Dimitry Ivanovb943f302016-08-03 16:00:10 -0700198 "linker_namespaces.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700199 "linker_logger.cpp",
200 "linker_mapped_file_fragment.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100201 "linker_note_gnu_property.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700202 "linker_phdr.cpp",
Ryan Prichard339ecef2020-01-02 16:36:06 -0800203 "linker_relocate.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700204 "linker_sdk_versions.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700205 "linker_soinfo.cpp",
Collin Fijalkovich47d27aa2021-03-24 10:17:39 -0700206 "linker_transparent_hugepage_support.cpp",
Ryan Prichard45d13492019-01-03 02:51:30 -0800207 "linker_tls.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700208 "linker_utils.cpp",
209 "rt.cpp",
210 ],
dimitryb8b3a762018-09-25 12:31:11 +0200211}
Colin Cross97f0aef2016-07-14 16:05:46 -0700212
dimitryb8b3a762018-09-25 12:31:11 +0200213filegroup {
214 name: "linker_sources_arm",
215 srcs: [
216 "arch/arm/begin.S",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800217 "arch/arm_neon/linker_gnu_hash_neon.cpp",
dimitryb8b3a762018-09-25 12:31:11 +0200218 ],
219}
220
221filegroup {
222 name: "linker_sources_arm64",
223 srcs: [
224 "arch/arm64/begin.S",
Ryan Prichardffaae702019-01-23 17:47:10 -0800225 "arch/arm64/tlsdesc_resolver.S",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800226 "arch/arm_neon/linker_gnu_hash_neon.cpp",
dimitryb8b3a762018-09-25 12:31:11 +0200227 ],
228}
229
230filegroup {
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000231 name: "linker_sources_riscv64",
232 srcs: [
233 "arch/riscv64/begin.S",
Paul Kirth4d437782024-01-30 23:03:14 +0000234 "arch/riscv64/tlsdesc_resolver.S",
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000235 ],
236}
237
238filegroup {
dimitryb8b3a762018-09-25 12:31:11 +0200239 name: "linker_sources_x86",
240 srcs: [
241 "arch/x86/begin.S",
242 ],
243}
244
245filegroup {
246 name: "linker_sources_x86_64",
247 srcs: [
248 "arch/x86_64/begin.S",
249 ],
250}
251
dimitryb8b3a762018-09-25 12:31:11 +0200252cc_defaults {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700253 name: "linker_version_script_overlay",
254 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000255 arm: {
256 version_script: "linker.arm.map",
257 },
258 arm64: {
259 version_script: "linker.generic.map",
260 },
261 riscv64: {
262 version_script: "linker.generic.map",
263 },
264 x86: {
265 version_script: "linker.generic.map",
266 },
267 x86_64: {
268 version_script: "linker.generic.map",
269 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700270 },
271}
272
273// A template for the linker binary. May be inherited by native bridge implementations.
274cc_defaults {
275 name: "linker_bin_template",
Elliott Hughes89aada12024-07-01 21:59:04 +0000276 defaults: [
277 "linker_defaults",
278 "keep_symbols",
279 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700280
281 srcs: [":linker_sources"],
282
Colin Cross97f0aef2016-07-14 16:05:46 -0700283 arch: {
284 arm: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700285 srcs: [":linker_sources_arm"],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700286 },
287 arm64: {
288 srcs: [":linker_sources_arm64"],
Colin Cross97f0aef2016-07-14 16:05:46 -0700289 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000290 riscv64: {
291 srcs: [":linker_sources_riscv64"],
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000292 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700293 x86: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700294 srcs: [":linker_sources_x86"],
295 },
296 x86_64: {
297 srcs: [":linker_sources_x86_64"],
298 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700299 },
300
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000301 static_executable: true,
302
Ryan Prichard80e40f02019-10-31 19:54:46 -0700303 // -shared is used to overwrite the -Bstatic and -static flags triggered by enabling
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000304 // static_executable. The dynamic linker is actually a shared object linked with static
Ryan Prichard80e40f02019-10-31 19:54:46 -0700305 // libraries.
Colin Cross97f0aef2016-07-14 16:05:46 -0700306 ldflags: [
307 "-shared",
308 "-Wl,-Bsymbolic",
309 "-Wl,--exclude-libs,ALL",
dimitry8e8c2c02018-01-04 12:08:32 +0100310 "-Wl,-soname,ld-android.so",
Peter Collingbournec630da52024-03-26 13:24:06 -0700311 // When the linker applies its own IRELATIVE relocations, it will only read DT_REL[A] and
312 // DT_JMPREL, not DT_ANDROID_REL[A], which can also theoretically contain IRELATIVE
313 // relocations. lld has been taught to not store them there as a bug workaround (see
314 // https://llvm.org/pr86751) but the workaround could be removed at some point in the
315 // future. So we explicitly prevent it from doing so by disabling DT_ANDROID_REL[A] when
316 // linking the linker (DT_RELR cannot encode IRELATIVE relocations).
317 "-Wl,--pack-dyn-relocs=relr",
Colin Cross97f0aef2016-07-14 16:05:46 -0700318 ],
319
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000320 // We link libc++_static manually because otherwise the build system will
321 // automatically add libdl to the list of static libraries.
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -0800322 stl: "none",
323
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000324 // We don't want crtbegin.o (because we have our own arch/*/begin.o),
325 // so unset it just for this module.
Colin Cross97f0aef2016-07-14 16:05:46 -0700326 nocrt: true,
327
dimitryb8b3a762018-09-25 12:31:11 +0200328 // Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb
329 // looking up symbols in the linker by mistake.
330 prefix_symbols: "__dl_",
331
332 sanitize: {
333 hwaddress: false,
Florian Mayerc0aa70a2024-06-24 15:49:20 -0700334 memtag_stack: false,
dimitryb8b3a762018-09-25 12:31:11 +0200335 },
dimitryb8b3a762018-09-25 12:31:11 +0200336
Colin Cross97f0aef2016-07-14 16:05:46 -0700337 static_libs: [
Ryan Prichard249757b2019-11-01 17:18:28 -0700338 "liblinker_main",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700339 "liblinker_malloc",
340
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000341 // We use a version of libc++ built without exceptions,
342 // because accessing EH globals uses ELF TLS,
343 // which is not supported in the loader.
Ryan Prichard0bac1cb2024-05-03 01:15:00 +0000344 "libc++_static_noexcept",
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000345
Colin Cross97f0aef2016-07-14 16:05:46 -0700346 "libc_nomalloc",
Ryan Prichard249757b2019-11-01 17:18:28 -0700347 "libc_dynamic_dispatch",
Dimitry Ivanov451909d2017-01-26 16:52:59 -0800348 "libm",
Ryan Prichardcdf71752020-12-16 03:37:22 -0800349 "libunwind",
Colin Cross97f0aef2016-07-14 16:05:46 -0700350 ],
Colin Cross97f0aef2016-07-14 16:05:46 -0700351
Ryan Prichard80e40f02019-10-31 19:54:46 -0700352 system_shared_libs: [],
353
354 // Opt out of native_coverage when opting out of system_shared_libs
355 native_coverage: false,
356}
357
358// ========================================================
359// linker[_asan][64] binary
360// ========================================================
361
362cc_binary {
Colin Cross97f0aef2016-07-14 16:05:46 -0700363 name: "linker",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700364 defaults: [
365 "linker_bin_template",
366 "linux_bionic_supported",
367 "linker_version_script_overlay",
368 ],
369
Victor Khimenkod15229d2020-05-14 22:14:45 +0200370 srcs: [
371 "linker_translate_path.cpp",
372 ],
373
Colin Cross10fffb42016-12-08 09:57:35 -0800374 symlinks: ["linker_asan"],
Florian Mayerc10d0642023-03-22 16:12:49 -0700375 arch: {
376 arm64: {
377 symlinks: ["linker_hwasan"],
378 },
379 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700380 multilib: {
Colin Cross97f0aef2016-07-14 16:05:46 -0700381 lib64: {
382 suffix: "64",
Colin Cross10fffb42016-12-08 09:57:35 -0800383 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700384 },
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800385
Ryan Prichard80e40f02019-10-31 19:54:46 -0700386 compile_multilib: "both",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700387
388 recovery_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700389 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700390 apex_available: [
391 "//apex_available:platform",
392 "com.android.runtime",
393 ],
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800394
Colin Cross97f0aef2016-07-14 16:05:46 -0700395 target: {
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800396 android: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700397 srcs: [
398 "linker_debuggerd_android.cpp",
399 ],
Dan Albert4ea19212019-07-23 13:31:14 -0700400 static_libs: [
Ryan Prichard0bac1cb2024-05-03 01:15:00 +0000401 "libc++demangle_noexcept",
Dan Albert4ea19212019-07-23 13:31:14 -0700402 "libdebuggerd_handler_fallback",
403 ],
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800404 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700405 linux_bionic: {
406 static_libs: [
407 "liblinker_debuggerd_stub",
408 ],
Yi Kong6f6daaa2020-12-10 01:27:44 +0800409 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700410 },
Yi Konga7e363f2020-10-01 04:10:01 +0800411
Yi Konge20a1d92022-01-25 03:19:58 +0800412 afdo: true,
Colin Cross97f0aef2016-07-14 16:05:46 -0700413}
dimitry11da1dc2018-01-05 13:35:43 +0100414
Ryan Prichard80e40f02019-10-31 19:54:46 -0700415// ========================================================
416// assorted modules
417// ========================================================
418
Elliott Hughes90f96b92019-05-09 15:56:39 -0700419sh_binary {
420 name: "ldd",
Rupert Shuttlewortha7e29a82021-02-18 13:35:22 +0000421 src: "ldd.sh",
Elliott Hughes90f96b92019-05-09 15:56:39 -0700422}
423
Collin Fijalkovichc9521e02021-04-29 11:31:50 -0700424// Used to generate binaries that can be backed by transparent hugepages.
425cc_defaults {
426 name: "linker_hugepage_aligned",
427 arch: {
428 arm64: {
429 ldflags: ["-z max-page-size=0x200000"],
430 },
431 x86_64: {
432 ldflags: ["-z max-page-size=0x200000"],
433 },
434 },
435}
436
dimitry11da1dc2018-01-05 13:35:43 +0100437cc_library {
dimitry581723e2018-01-05 14:31:44 +0100438 srcs: ["ld_android.cpp"],
dimitry11da1dc2018-01-05 13:35:43 +0100439 cflags: [
440 "-Wall",
441 "-Wextra",
442 "-Wunused",
443 "-Werror",
444 ],
445 stl: "none",
446
447 name: "ld-android",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000448 defaults: [
449 "linux_bionic_supported",
450 "linker_version_script_overlay",
451 ],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800452 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700453 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +0900454 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200455 native_bridge_supported: true,
dimitry11da1dc2018-01-05 13:35:43 +0100456
Ryan Prichard470b6662018-03-27 22:10:55 -0700457 nocrt: true,
dimitry11da1dc2018-01-05 13:35:43 +0100458 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100459 header_libs: ["libc_headers"],
dimitry11da1dc2018-01-05 13:35:43 +0100460
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800461 // Opt out of native_coverage when opting out of system_shared_libs
462 native_coverage: false,
463
dimitry11da1dc2018-01-05 13:35:43 +0100464 sanitize: {
465 never: true,
466 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900467
468 apex_available: [
469 "//apex_available:platform",
470 "com.android.runtime",
471 ],
dimitry11da1dc2018-01-05 13:35:43 +0100472}
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800473
474cc_test {
475 name: "linker-unit-tests",
Colin Cross0cc60af2021-09-30 14:04:39 -0700476 test_suites: ["device-tests"],
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800477
478 cflags: [
479 "-g",
480 "-Wall",
481 "-Wextra",
482 "-Wunused",
483 "-Werror",
484 ],
485
486 // We need to access Bionic private headers in the linker.
487 include_dirs: ["bionic/libc"],
488
489 srcs: [
490 // Tests.
491 "linker_block_allocator_test.cpp",
492 "linker_config_test.cpp",
493 "linked_list_test.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100494 "linker_note_gnu_property_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800495 "linker_sleb128_test.cpp",
496 "linker_utils_test.cpp",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800497 "linker_gnu_hash_test.cpp",
Kalesh Singh0396f872024-02-02 22:11:08 -0800498 "linker_crt_pad_segment_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800499
500 // Parts of the linker that we're testing.
Kalesh Singh0396f872024-02-02 22:11:08 -0800501 ":elf_note_sources",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800502 "linker_block_allocator.cpp",
503 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800504 "linker_debug.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100505 "linker_note_gnu_property.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800506 "linker_test_globals.cpp",
507 "linker_utils.cpp",
Kalesh Singh0396f872024-02-02 22:11:08 -0800508 "linker_phdr.cpp",
509 "linker_mapped_file_fragment.cpp",
510 "linker_sdk_versions.cpp",
511 "linker_dlwarning.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800512 ],
513
514 static_libs: [
515 "libasync_safe",
516 "libbase",
Jiyong Park7157dfb2022-08-19 13:09:18 +0900517 "liblog_for_runtime_apex",
Kalesh Singh4084b552024-03-13 13:35:49 -0700518 "libprocinfo", // For procinfo::MappedFileSize()
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800519 ],
Ryan Prichard129f7a12019-12-23 16:45:47 -0800520
Kalesh Singh0396f872024-02-02 22:11:08 -0800521 data_libs: [
522 "crt_pad_segment_disabled",
523 "crt_pad_segment_enabled",
524 "no_crt_pad_segment",
525 ],
526
Ryan Prichard129f7a12019-12-23 16:45:47 -0800527 arch: {
528 arm: {
529 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
530 },
531 arm64: {
532 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
533 },
534 },
535}
536
537cc_benchmark {
538 name: "linker-benchmarks",
539
540 srcs: [
541 "linker_gnu_hash_benchmark.cpp",
542 ],
543
544 arch: {
545 arm: {
546 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
547 },
548 arm64: {
549 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
550 },
551 },
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800552}