1# Copyright 2022 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load(":pigweed_internal.bzl", "pw_linker_script") 16 17pw_linker_script( 18 name = "linker_script_test", 19 defines = [ 20 "PW_BOOT_FLASH_BEGIN=0x08000200", 21 "PW_BOOT_FLASH_SIZE=1024K", 22 "PW_BOOT_HEAP_SIZE=112K", 23 "PW_BOOT_MIN_STACK_SIZE=1K", 24 "PW_BOOT_RAM_BEGIN=0x20000000", 25 "PW_BOOT_RAM_SIZE=192K", 26 "PW_BOOT_VECTOR_TABLE_BEGIN=0x08000000", 27 "PW_BOOT_VECTOR_TABLE_SIZE=512", 28 ], 29 linker_script = "linker_script.ld", 30) 31 32# Use cc_binary to build the test to avoid duplicating the linker script in the 33# command line via implicit deps in pw_cc_binary. 34cc_binary( 35 name = "test_linker_script", 36 srcs = ["test.cc"], 37 additional_linker_inputs = [":linker_script_test"], 38 linkopts = ["-T $(location :linker_script_test)"], 39) 40