/*
 * Linkage configuration.
 */

/* region (origin, length) */
ROM (0x08000000, 1M)
 /* SRAM: 320K (256K RAM + 64K for TCM RAM) */
RAM (0x20000000, 320K)
region (QSPI,  0x90000000, 16M)
//region (RAM, 0x60500000, 3M)

/* section (region[, lma_region]) */
text   (ROM)
rodata (ROM)
data   (RAM, ROM)
bss    (RAM)

/* InitFS */
section (initfs, QSPI, QSPI)
phdr    (initfs, PT_LOAD, FLAGS(5))

/* OpenCV core */
section (cv_core_text, QSPI, QSPI)
phdr    (cv_core_text, PT_LOAD, FLAGS(5))

section (cv_core_rodata, QSPI, QSPI)
phdr    (cv_core_rodata, PT_LOAD, FLAGS(5))

section (cv_core_arm_exidx, QSPI, QSPI)
phdr    (cv_core_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_core_arm_extab, QSPI, QSPI)
phdr    (cv_core_arm_extab, PT_LOAD, FLAGS(5))

section (cv_core_data, RAM, QSPI)
phdr    (cv_core_data, PT_LOAD, FLAGS(6))

section (cv_core_bss, RAM, QSPI)
phdr    (cv_core_bss, PT_LOAD, FLAGS(6))

/* OpenCV imgcodecs */
section (cv_imgcodecs_text, QSPI, QSPI)
phdr    (cv_imgcodecs_text, PT_LOAD, FLAGS(5))

section (cv_imgcodecs_rodata, QSPI, QSPI)
phdr    (cv_imgcodecs_rodata, PT_LOAD, FLAGS(5))

section (cv_imgcodecs_arm_exidx, QSPI, QSPI)
phdr    (cv_imgcodecs_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_imgcodecs_arm_extab, QSPI, QSPI)
phdr    (cv_imgcodecs_arm_extab, PT_LOAD, FLAGS(5))

section (cv_imgcodecs_data, RAM, QSPI)
phdr    (cv_imgcodecs_data, PT_LOAD, FLAGS(6))

section (cv_imgcodecs_bss, RAM, QSPI)
phdr    (cv_imgcodecs_bss, PT_LOAD, FLAGS(6))

/* OpenCV imgproc */
section (cv_imgproc_text, QSPI, QSPI)
phdr    (cv_imgproc_text, PT_LOAD, FLAGS(5))

section (cv_imgproc_rodata, QSPI, QSPI)
phdr    (cv_imgproc_rodata, PT_LOAD, FLAGS(5))

section (cv_imgproc_arm_exidx, QSPI, QSPI)
phdr    (cv_imgproc_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_imgproc_arm_extab, QSPI, QSPI)
phdr    (cv_imgproc_arm_extab, PT_LOAD, FLAGS(5))

section (cv_imgproc_data, RAM, QSPI)
phdr    (cv_imgproc_data, PT_LOAD, FLAGS(6))

section (cv_imgproc_bss, RAM, QSPI)
phdr    (cv_imgproc_bss, PT_LOAD, FLAGS(6))

/* OpenCV objdetect */
section (cv_objdetect_text, QSPI, QSPI)
phdr    (cv_objdetect_text, PT_LOAD, FLAGS(5))

section (cv_objdetect_rodata, QSPI, QSPI)
phdr    (cv_objdetect_rodata, PT_LOAD, FLAGS(5))

section (cv_objdetect_arm_exidx, QSPI, QSPI)
phdr    (cv_objdetect_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_objdetect_arm_extab, QSPI, QSPI)
phdr    (cv_objdetect_arm_extab, PT_LOAD, FLAGS(5))

section (cv_objdetect_data, RAM, QSPI)
phdr    (cv_objdetect_data, PT_LOAD, FLAGS(6))

section (cv_objdetect_bss, RAM, QSPI)
phdr    (cv_objdetect_bss, PT_LOAD, FLAGS(6))

/* OpenCV videoio */
section (cv_videoio_text, QSPI, QSPI)
phdr    (cv_videoio_text, PT_LOAD, FLAGS(5))

section (cv_videoio_rodata, QSPI, QSPI)
phdr    (cv_videoio_rodata, PT_LOAD, FLAGS(5))

section (cv_videoio_arm_exidx, QSPI, QSPI)
phdr    (cv_videoio_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_videoio_arm_extab, QSPI, QSPI)
phdr    (cv_videoio_arm_extab, PT_LOAD, FLAGS(5))

section (cv_videoio_data, RAM, QSPI)
phdr    (cv_videoio_data, PT_LOAD, FLAGS(6))

section (cv_videoio_bss, RAM, QSPI)
phdr    (cv_videoio_bss, PT_LOAD, FLAGS(6))

/* OpenCV calib3d */
section (cv_calib3d_text, QSPI, QSPI)
phdr    (cv_calib3d_text, PT_LOAD, FLAGS(5))

section (cv_calib3d_rodata, QSPI, QSPI)
phdr    (cv_calib3d_rodata, PT_LOAD, FLAGS(5))

section (cv_calib3d_arm_exidx, QSPI, QSPI)
phdr    (cv_calib3d_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_calib3d_arm_extab, QSPI, QSPI)
phdr    (cv_calib3d_arm_extab, PT_LOAD, FLAGS(5))

section (cv_calib3d_data, RAM, QSPI)
phdr    (cv_calib3d_data, PT_LOAD, FLAGS(6))

section (cv_calib3d_bss, RAM, QSPI)
phdr    (cv_calib3d_bss, PT_LOAD, FLAGS(6))

/* OpenCV flann */
section (cv_flann_text, QSPI, QSPI)
phdr    (cv_flann_text, PT_LOAD, FLAGS(5))

section (cv_flann_rodata, QSPI, QSPI)
phdr    (cv_flann_rodata, PT_LOAD, FLAGS(5))

section (cv_flann_arm_exidx, QSPI, QSPI)
phdr    (cv_flann_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_flann_arm_extab, QSPI, QSPI)
phdr    (cv_flann_arm_extab, PT_LOAD, FLAGS(5))

section (cv_flann_data, RAM, QSPI)
phdr    (cv_flann_data, PT_LOAD, FLAGS(6))

section (cv_flann_bss, RAM, QSPI)
phdr    (cv_flann_bss, PT_LOAD, FLAGS(6))

/* OpenCV features2d */
section (cv_features2d_text, QSPI, QSPI)
phdr    (cv_features2d_text, PT_LOAD, FLAGS(5))

section (cv_features2d_rodata, QSPI, QSPI)
phdr    (cv_features2d_rodata, PT_LOAD, FLAGS(5))

section (cv_features2d_arm_exidx, QSPI, QSPI)
phdr    (cv_features2d_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_features2d_arm_extab, QSPI, QSPI)
phdr    (cv_features2d_arm_extab, PT_LOAD, FLAGS(5))

section (cv_features2d_data, RAM, QSPI)
phdr    (cv_features2d_data, PT_LOAD, FLAGS(6))

section (cv_features2d_bss, RAM, QSPI)
phdr    (cv_features2d_bss, PT_LOAD, FLAGS(6))

/* OpenCV png */
section (cv_png_text, QSPI, QSPI)
phdr    (cv_png_text, PT_LOAD, FLAGS(5))

section (cv_png_rodata, QSPI, QSPI)
phdr    (cv_png_rodata, PT_LOAD, FLAGS(5))

section (cv_png_arm_exidx, QSPI, QSPI)
phdr    (cv_png_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_png_arm_extab, QSPI, QSPI)
phdr    (cv_png_arm_extab, PT_LOAD, FLAGS(5))

section (cv_png_data, RAM, QSPI)
phdr    (cv_png_data, PT_LOAD, FLAGS(6))

section (cv_png_bss, RAM, QSPI)
phdr    (cv_png_bss, PT_LOAD, FLAGS(6))

/* OpenCV zlib */
section (cv_zlib_text, QSPI, QSPI)
phdr    (cv_zlib_text, PT_LOAD, FLAGS(5))

section (cv_zlib_rodata, QSPI, QSPI)
phdr    (cv_zlib_rodata, PT_LOAD, FLAGS(5))

section (cv_zlib_arm_exidx, QSPI, QSPI)
phdr    (cv_zlib_arm_exidx, PT_LOAD, FLAGS(5))

section (cv_zlib_arm_extab, QSPI, QSPI)
phdr    (cv_zlib_arm_extab, PT_LOAD, FLAGS(5))

section (cv_zlib_data, RAM, QSPI)
phdr    (cv_zlib_data, PT_LOAD, FLAGS(6))

section (cv_zlib_bss, RAM, QSPI)
phdr    (cv_zlib_bss, PT_LOAD, FLAGS(6))

/* OpenCV edges example */
section (edges_text, QSPI, QSPI)
phdr    (edges_text, PT_LOAD, FLAGS(5))

section (edges_rodata, QSPI, QSPI)
phdr    (edges_rodata, PT_LOAD, FLAGS(5))

section (edges_arm_exidx, QSPI, QSPI)
phdr    (edges_arm_exidx, PT_LOAD, FLAGS(5))

section (edges_arm_extab, QSPI, QSPI)
phdr    (edges_arm_extab, PT_LOAD, FLAGS(5))

section (edges_data, RAM, QSPI)
phdr    (edges_data, PT_LOAD, FLAGS(6))

section (edges_bss, RAM, QSPI)
phdr    (edges_bss, PT_LOAD, FLAGS(6))

/* libstdc++.a */
section (libstdcxx_text, QSPI, QSPI)
phdr    (libstdcxx_text, PT_LOAD, FLAGS(5))

section (libstdcxx_rodata, QSPI, QSPI)
phdr    (libstdcxx_rodata, PT_LOAD, FLAGS(5))

section (libstdcxx_arm_exidx, QSPI, QSPI)
phdr    (libstdcxx_arm_exidx, PT_LOAD, FLAGS(5))

section (libstdcxx_arm_extab, QSPI, QSPI)
phdr    (libstdcxx_arm_extab, PT_LOAD, FLAGS(5))

section (libstdcxx_data, RAM, QSPI)
phdr    (libstdcxx_data, PT_LOAD, FLAGS(6))

section (libstdcxx_bss, RAM, QSPI)
phdr    (libstdcxx_bss, PT_LOAD, FLAGS(6))

/* libsupc++.a */
section (libsupcxx_text, QSPI, QSPI)
phdr    (libsupcxx_text, PT_LOAD, FLAGS(5))

section (libsupcxx_rodata, QSPI, QSPI)
phdr    (libsupcxx_rodata, PT_LOAD, FLAGS(5))

section (libsupcxx_arm_exidx, QSPI, QSPI)
phdr    (libsupcxx_arm_exidx, PT_LOAD, FLAGS(5))

section (libsupcxx_arm_extab, QSPI, QSPI)
phdr    (libsupcxx_arm_extab, PT_LOAD, FLAGS(5))

section (libsupcxx_data, RAM, QSPI)
phdr    (libsupcxx_data, PT_LOAD, FLAGS(6))

section (libsupcxx_bss, RAM, QSPI)
phdr    (libsupcxx_bss, PT_LOAD, FLAGS(6))
