blob: 4863b9207c6bc74b42047cedc0eb148f34881832 [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 Hughesb1b2e372024-07-08 14:27:46 +000017linker_common_flags = [
18 "-fno-stack-protector",
19 "-Wstrict-overflow=5",
20 "-fvisibility=hidden",
21 "-Wall",
22 "-Wextra",
23 "-Wunused",
24 "-Werror",
25]
26
Elliott Hughes4b5d62e2024-06-20 16:21:08 +000027// ========================================================
28// linker_wrapper - Linux Bionic (on the host)
29// ========================================================
30
31// This is used for bionic on (host) Linux to bootstrap our linker embedded into
32// a binary.
33//
34// Host bionic binaries do not have a PT_INTERP section, instead this gets
35// embedded as the entry point, and the linker is embedded as ELF sections in
36// each binary. There's a linker script that sets all of that up (generated by
37// extract_linker), and defines the extern symbols used in this file.
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070038cc_object {
39 name: "linker_wrapper",
40 host_supported: true,
41 device_supported: false,
Colin Crossda446cc2022-03-08 15:07:57 -080042 enabled: false,
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070043 target: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -080044 linux_bionic: {
45 enabled: true,
46 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070047 },
48
Elliott Hughesb1b2e372024-07-08 14:27:46 +000049 cflags: linker_common_flags,
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070050
51 srcs: [
52 "linker_wrapper.cpp",
53 ],
54 arch: {
Jiyong Park3b47d602020-09-18 16:15:53 +090055 arm64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070056 srcs: ["arch/arm64/linker_wrapper_begin.S"],
Jiyong Park3b47d602020-09-18 16:15:53 +090057 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +000058 riscv64: {
59 srcs: ["arch/riscv64/linker_wrapper_begin.S"],
60 },
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070061 x86_64: {
Colin Crossa0a591a2021-06-11 12:46:45 -070062 srcs: ["arch/x86_64/linker_wrapper_begin.S"],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070063 },
64 },
65
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010066 header_libs: ["libc_headers"],
67
Dan Willemsen7ccc50d2017-09-18 21:28:14 -070068 // We need to access Bionic private headers in the linker.
69 include_dirs: ["bionic/libc"],
70}
71
Ryan Prichard80e40f02019-10-31 19:54:46 -070072// ========================================================
73// linker default configuration
74// ========================================================
75
76// Configuration for the linker binary and any of its static libraries.
77cc_defaults {
78 name: "linker_defaults",
79 arch: {
80 arm: {
81 cflags: ["-D__work_around_b_24465209__"],
82 },
83 x86: {
84 cflags: ["-D__work_around_b_24465209__"],
85 },
86 },
87
Elliott Hughesb1b2e372024-07-08 14:27:46 +000088 cflags: linker_common_flags,
89 asflags: linker_common_flags,
Ryan Prichard80e40f02019-10-31 19:54:46 -070090
91 product_variables: {
92 debuggable: {
93 cppflags: ["-DUSE_LD_CONFIG_FILE"],
94 },
95 },
96
97 cppflags: ["-Wold-style-cast"],
98
99 static_libs: [
100 "libziparchive",
101 "libbase",
102 "libz",
103
104 "libasync_safe",
105
Jiyong Park7157dfb2022-08-19 13:09:18 +0900106 "liblog_for_runtime_apex",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700107 ],
108
109 // We need to access Bionic private headers in the linker.
110 include_dirs: ["bionic/libc"],
Florian Mayer4edc20d2024-10-30 14:24:26 -0700111
112 sanitize: {
113 // Supporting memtag_globals in the linker would be tricky,
114 // because it relocates itself very early.
115 memtag_globals: false,
116 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700117}
118
119// ========================================================
120// linker components
121// ========================================================
122
123// Enable a module on all targets the linker runs on (ordinary Android targets, Linux Bionic, and
124// native bridge implementations).
125cc_defaults {
126 name: "linker_all_targets",
127 defaults: ["linux_bionic_supported"],
128 recovery_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700129 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700130 native_bridge_supported: true,
131}
132
133cc_library_static {
Ryan Prichard249757b2019-11-01 17:18:28 -0700134 name: "liblinker_main",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000135 defaults: [
136 "linker_defaults",
137 "linker_all_targets",
138 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700139 srcs: ["linker_main.cpp"],
140
141 // Ensure that the compiler won't insert string function calls before ifuncs are resolved.
142 cflags: ["-ffreestanding"],
Spandan Das0a6cfe92024-01-04 18:06:50 +0000143 apex_available: [
144 "com.android.runtime",
145 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700146}
147
148cc_library_static {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700149 name: "liblinker_malloc",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000150 defaults: [
151 "linker_defaults",
152 "linker_all_targets",
153 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700154 srcs: ["linker_memory.cpp"],
Spandan Das0a6cfe92024-01-04 18:06:50 +0000155 apex_available: [
156 "com.android.runtime",
157 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700158}
159
160cc_library_static {
161 name: "liblinker_debuggerd_stub",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000162 defaults: [
163 "linker_defaults",
164 "linker_all_targets",
165 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700166 srcs: ["linker_debuggerd_stub.cpp"],
167}
168
169// ========================================================
170// template for the linker binary
171// ========================================================
172
dimitryb8b3a762018-09-25 12:31:11 +0200173filegroup {
174 name: "linker_sources",
Colin Cross97f0aef2016-07-14 16:05:46 -0700175 srcs: [
176 "dlfcn.cpp",
177 "linker.cpp",
Elliott Hughes838dbac2023-08-22 14:07:48 -0700178 "linker_auxv.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700179 "linker_block_allocator.cpp",
Dimitry Ivanov769b33f2016-07-21 11:33:40 -0700180 "linker_dlwarning.cpp",
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700181 "linker_cfi.cpp",
Dimitry Ivanov4cabfaa2017-03-07 11:19:05 -0800182 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800183 "linker_debug.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700184 "linker_gdb_support.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700185 "linker_globals.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700186 "linker_libc_support.c",
Dimitry Ivanov451909d2017-01-26 16:52:59 -0800187 "linker_libcxx_support.cpp",
Dimitry Ivanovb943f302016-08-03 16:00:10 -0700188 "linker_namespaces.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700189 "linker_logger.cpp",
190 "linker_mapped_file_fragment.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100191 "linker_note_gnu_property.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700192 "linker_phdr.cpp",
Kalesh Singhce1c3cf2024-09-30 13:26:23 -0700193 "linker_phdr_16kib_compat.cpp",
Ryan Prichard339ecef2020-01-02 16:36:06 -0800194 "linker_relocate.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700195 "linker_sdk_versions.cpp",
Dimitry Ivanov48ec2882016-08-04 11:50:36 -0700196 "linker_soinfo.cpp",
Collin Fijalkovich47d27aa2021-03-24 10:17:39 -0700197 "linker_transparent_hugepage_support.cpp",
Ryan Prichard45d13492019-01-03 02:51:30 -0800198 "linker_tls.cpp",
Colin Cross97f0aef2016-07-14 16:05:46 -0700199 "linker_utils.cpp",
200 "rt.cpp",
201 ],
dimitryb8b3a762018-09-25 12:31:11 +0200202}
Colin Cross97f0aef2016-07-14 16:05:46 -0700203
dimitryb8b3a762018-09-25 12:31:11 +0200204filegroup {
205 name: "linker_sources_arm",
206 srcs: [
207 "arch/arm/begin.S",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800208 "arch/arm_neon/linker_gnu_hash_neon.cpp",
dimitryb8b3a762018-09-25 12:31:11 +0200209 ],
210}
211
212filegroup {
213 name: "linker_sources_arm64",
214 srcs: [
215 "arch/arm64/begin.S",
Ryan Prichardffaae702019-01-23 17:47:10 -0800216 "arch/arm64/tlsdesc_resolver.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 {
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000222 name: "linker_sources_riscv64",
223 srcs: [
224 "arch/riscv64/begin.S",
Paul Kirth4d437782024-01-30 23:03:14 +0000225 "arch/riscv64/tlsdesc_resolver.S",
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000226 ],
227}
228
229filegroup {
dimitryb8b3a762018-09-25 12:31:11 +0200230 name: "linker_sources_x86",
231 srcs: [
232 "arch/x86/begin.S",
233 ],
234}
235
236filegroup {
237 name: "linker_sources_x86_64",
238 srcs: [
239 "arch/x86_64/begin.S",
240 ],
241}
242
dimitryb8b3a762018-09-25 12:31:11 +0200243cc_defaults {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700244 name: "linker_version_script_overlay",
245 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000246 arm: {
247 version_script: "linker.arm.map",
248 },
249 arm64: {
250 version_script: "linker.generic.map",
251 },
252 riscv64: {
253 version_script: "linker.generic.map",
254 },
255 x86: {
256 version_script: "linker.generic.map",
257 },
258 x86_64: {
259 version_script: "linker.generic.map",
260 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700261 },
262}
263
264// A template for the linker binary. May be inherited by native bridge implementations.
265cc_defaults {
266 name: "linker_bin_template",
Elliott Hughes89aada12024-07-01 21:59:04 +0000267 defaults: [
268 "linker_defaults",
269 "keep_symbols",
270 ],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700271
272 srcs: [":linker_sources"],
273
Colin Cross97f0aef2016-07-14 16:05:46 -0700274 arch: {
275 arm: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700276 srcs: [":linker_sources_arm"],
Ryan Prichard80e40f02019-10-31 19:54:46 -0700277 },
278 arm64: {
279 srcs: [":linker_sources_arm64"],
Colin Cross97f0aef2016-07-14 16:05:46 -0700280 },
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000281 riscv64: {
282 srcs: [":linker_sources_riscv64"],
Elliott Hughes3e4f6032022-10-22 03:54:59 +0000283 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700284 x86: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700285 srcs: [":linker_sources_x86"],
286 },
287 x86_64: {
288 srcs: [":linker_sources_x86_64"],
289 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700290 },
291
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000292 static_executable: true,
293
Ryan Prichard80e40f02019-10-31 19:54:46 -0700294 // -shared is used to overwrite the -Bstatic and -static flags triggered by enabling
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000295 // static_executable. The dynamic linker is actually a shared object linked with static
Ryan Prichard80e40f02019-10-31 19:54:46 -0700296 // libraries.
Colin Cross97f0aef2016-07-14 16:05:46 -0700297 ldflags: [
298 "-shared",
299 "-Wl,-Bsymbolic",
300 "-Wl,--exclude-libs,ALL",
dimitry8e8c2c02018-01-04 12:08:32 +0100301 "-Wl,-soname,ld-android.so",
Peter Collingbournec630da52024-03-26 13:24:06 -0700302 // When the linker applies its own IRELATIVE relocations, it will only read DT_REL[A] and
303 // DT_JMPREL, not DT_ANDROID_REL[A], which can also theoretically contain IRELATIVE
304 // relocations. lld has been taught to not store them there as a bug workaround (see
305 // https://llvm.org/pr86751) but the workaround could be removed at some point in the
306 // future. So we explicitly prevent it from doing so by disabling DT_ANDROID_REL[A] when
307 // linking the linker (DT_RELR cannot encode IRELATIVE relocations).
308 "-Wl,--pack-dyn-relocs=relr",
Colin Cross97f0aef2016-07-14 16:05:46 -0700309 ],
310
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000311 // We link libc++_static manually because otherwise the build system will
312 // automatically add libdl to the list of static libraries.
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -0800313 stl: "none",
314
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000315 // We don't want crtbegin.o (because we have our own arch/*/begin.o),
316 // so unset it just for this module.
Colin Cross97f0aef2016-07-14 16:05:46 -0700317 nocrt: true,
318
dimitryb8b3a762018-09-25 12:31:11 +0200319 // Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb
320 // looking up symbols in the linker by mistake.
321 prefix_symbols: "__dl_",
322
323 sanitize: {
324 hwaddress: false,
Florian Mayerc0aa70a2024-06-24 15:49:20 -0700325 memtag_stack: false,
dimitryb8b3a762018-09-25 12:31:11 +0200326 },
dimitryb8b3a762018-09-25 12:31:11 +0200327
Colin Cross97f0aef2016-07-14 16:05:46 -0700328 static_libs: [
Ryan Prichard249757b2019-11-01 17:18:28 -0700329 "liblinker_main",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700330 "liblinker_malloc",
331
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000332 // We use a version of libc++ built without exceptions,
333 // because accessing EH globals uses ELF TLS,
334 // which is not supported in the loader.
Ryan Prichard0bac1cb2024-05-03 01:15:00 +0000335 "libc++_static_noexcept",
Elliott Hughes4b5d62e2024-06-20 16:21:08 +0000336
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 Prichard80e40f02019-10-31 19:54:46 -0700343 system_shared_libs: [],
344
345 // Opt out of native_coverage when opting out of system_shared_libs
346 native_coverage: false,
347}
348
349// ========================================================
350// linker[_asan][64] binary
351// ========================================================
352
Liana Kazanova10d48c52024-12-07 01:31:09 +0000353cc_binary {
354 name: "linker",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700355 defaults: [
356 "linker_bin_template",
357 "linux_bionic_supported",
358 "linker_version_script_overlay",
359 ],
360
Victor Khimenkod15229d2020-05-14 22:14:45 +0200361 srcs: [
362 "linker_translate_path.cpp",
363 ],
364
Colin Cross10fffb42016-12-08 09:57:35 -0800365 symlinks: ["linker_asan"],
Florian Mayerc10d0642023-03-22 16:12:49 -0700366 arch: {
367 arm64: {
368 symlinks: ["linker_hwasan"],
369 },
370 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700371 multilib: {
Colin Cross97f0aef2016-07-14 16:05:46 -0700372 lib64: {
373 suffix: "64",
Colin Cross10fffb42016-12-08 09:57:35 -0800374 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700375 },
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800376
Ryan Prichard80e40f02019-10-31 19:54:46 -0700377 compile_multilib: "both",
Ryan Prichard80e40f02019-10-31 19:54:46 -0700378
Liana Kazanova10d48c52024-12-07 01:31:09 +0000379 recovery_available: true,
380 vendor_ramdisk_available: true,
Ryan Prichard80e40f02019-10-31 19:54:46 -0700381 apex_available: [
382 "//apex_available:platform",
383 "com.android.runtime",
384 ],
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800385
Colin Cross97f0aef2016-07-14 16:05:46 -0700386 target: {
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800387 android: {
Ryan Prichard80e40f02019-10-31 19:54:46 -0700388 srcs: [
389 "linker_debuggerd_android.cpp",
390 ],
Dan Albert4ea19212019-07-23 13:31:14 -0700391 static_libs: [
Ryan Prichard0bac1cb2024-05-03 01:15:00 +0000392 "libc++demangle_noexcept",
Dan Albert4ea19212019-07-23 13:31:14 -0700393 "libdebuggerd_handler_fallback",
394 ],
Dan Willemsen7ec52b12016-11-28 17:02:25 -0800395 },
Ryan Prichard80e40f02019-10-31 19:54:46 -0700396 linux_bionic: {
397 static_libs: [
398 "liblinker_debuggerd_stub",
399 ],
Yi Kong6f6daaa2020-12-10 01:27:44 +0800400 },
Colin Cross97f0aef2016-07-14 16:05:46 -0700401 },
Yi Konga7e363f2020-10-01 04:10:01 +0800402
Yi Konge20a1d92022-01-25 03:19:58 +0800403 afdo: true,
Colin Cross97f0aef2016-07-14 16:05:46 -0700404}
dimitry11da1dc2018-01-05 13:35:43 +0100405
Ryan Prichard80e40f02019-10-31 19:54:46 -0700406// ========================================================
407// assorted modules
408// ========================================================
409
Elliott Hughes90f96b92019-05-09 15:56:39 -0700410sh_binary {
411 name: "ldd",
Rupert Shuttlewortha7e29a82021-02-18 13:35:22 +0000412 src: "ldd.sh",
Elliott Hughes90f96b92019-05-09 15:56:39 -0700413}
414
Collin Fijalkovichc9521e02021-04-29 11:31:50 -0700415// Used to generate binaries that can be backed by transparent hugepages.
416cc_defaults {
417 name: "linker_hugepage_aligned",
418 arch: {
419 arm64: {
420 ldflags: ["-z max-page-size=0x200000"],
421 },
422 x86_64: {
423 ldflags: ["-z max-page-size=0x200000"],
424 },
425 },
426}
427
dimitry11da1dc2018-01-05 13:35:43 +0100428cc_library {
dimitry581723e2018-01-05 14:31:44 +0100429 srcs: ["ld_android.cpp"],
dimitry11da1dc2018-01-05 13:35:43 +0100430 cflags: [
431 "-Wall",
432 "-Wextra",
433 "-Wunused",
434 "-Werror",
435 ],
436 stl: "none",
437
438 name: "ld-android",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000439 defaults: [
440 "linux_bionic_supported",
441 "linker_version_script_overlay",
442 ],
Yifan Hong5a39cee2020-01-21 16:43:56 -0800443 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -0700444 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +0900445 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +0200446 native_bridge_supported: true,
dimitry11da1dc2018-01-05 13:35:43 +0100447
Ryan Prichard470b6662018-03-27 22:10:55 -0700448 nocrt: true,
dimitry11da1dc2018-01-05 13:35:43 +0100449 system_shared_libs: [],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +0100450 header_libs: ["libc_headers"],
dimitry11da1dc2018-01-05 13:35:43 +0100451
Pirama Arumuga Nainarfcd35382019-02-14 13:48:01 -0800452 // Opt out of native_coverage when opting out of system_shared_libs
453 native_coverage: false,
454
dimitry11da1dc2018-01-05 13:35:43 +0100455 sanitize: {
456 never: true,
457 },
Jiyong Parke87e0dc2019-10-02 17:09:33 +0900458
459 apex_available: [
460 "//apex_available:platform",
461 "com.android.runtime",
462 ],
dimitry11da1dc2018-01-05 13:35:43 +0100463}
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800464
465cc_test {
466 name: "linker-unit-tests",
Colin Cross0cc60af2021-09-30 14:04:39 -0700467 test_suites: ["device-tests"],
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800468
469 cflags: [
470 "-g",
471 "-Wall",
472 "-Wextra",
473 "-Wunused",
474 "-Werror",
475 ],
476
477 // We need to access Bionic private headers in the linker.
478 include_dirs: ["bionic/libc"],
479
480 srcs: [
481 // Tests.
482 "linker_block_allocator_test.cpp",
483 "linker_config_test.cpp",
484 "linked_list_test.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100485 "linker_note_gnu_property_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800486 "linker_sleb128_test.cpp",
487 "linker_utils_test.cpp",
Ryan Prichard129f7a12019-12-23 16:45:47 -0800488 "linker_gnu_hash_test.cpp",
Kalesh Singh0396f872024-02-02 22:11:08 -0800489 "linker_crt_pad_segment_test.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800490
491 // Parts of the linker that we're testing.
Kalesh Singh0396f872024-02-02 22:11:08 -0800492 ":elf_note_sources",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800493 "linker_block_allocator.cpp",
494 "linker_config.cpp",
Ryan Prichard551565e2019-12-23 16:03:14 -0800495 "linker_debug.cpp",
Tamas Petz8d55d182020-02-24 14:15:25 +0100496 "linker_note_gnu_property.cpp",
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800497 "linker_test_globals.cpp",
498 "linker_utils.cpp",
Kalesh Singh0396f872024-02-02 22:11:08 -0800499 "linker_phdr.cpp",
500 "linker_mapped_file_fragment.cpp",
501 "linker_sdk_versions.cpp",
502 "linker_dlwarning.cpp",
Pawan Wagh8e5de062024-10-17 18:05:19 +0000503 "linker_phdr_16kib_compat.cpp"
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800504 ],
505
506 static_libs: [
507 "libasync_safe",
508 "libbase",
Jiyong Park7157dfb2022-08-19 13:09:18 +0900509 "liblog_for_runtime_apex",
Kalesh Singh4084b552024-03-13 13:35:49 -0700510 "libprocinfo", // For procinfo::MappedFileSize()
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800511 ],
Ryan Prichard129f7a12019-12-23 16:45:47 -0800512
Kalesh Singh0396f872024-02-02 22:11:08 -0800513 data_libs: [
514 "crt_pad_segment_disabled",
515 "crt_pad_segment_enabled",
516 "no_crt_pad_segment",
517 ],
518
Ryan Prichard129f7a12019-12-23 16:45:47 -0800519 arch: {
520 arm: {
521 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
522 },
523 arm64: {
524 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
525 },
526 },
527}
528
529cc_benchmark {
530 name: "linker-benchmarks",
531
532 srcs: [
533 "linker_gnu_hash_benchmark.cpp",
534 ],
535
536 arch: {
537 arm: {
538 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
539 },
540 arm64: {
541 srcs: ["arch/arm_neon/linker_gnu_hash_neon.cpp"],
542 },
543 },
Elliott Hughes15a2b7b2019-02-15 13:48:38 -0800544}