1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17SECTIONS { 18 . = SIZEOF_HEADERS; 19 .text : { 20 *(.text.*) 21 . = ALIGN(4096); 22 exec_region_start = .; 23 . += (512 * 1024); 24 . = ALIGN(4096); 25 exec_region_end = .; 26 } 27 .plt : { 28 *(.plt) 29 } 30 /* Align following segments on the page boundary to prevent 31 * next PT_LOAD segment from mapping over .plt section removing 32 * executable flag from .plt. See also http://b/254823538. 33 */ 34 . = ALIGN(4096); 35 .fini_array : { 36 *(.fini_array.*) 37 } 38 .init_array : { 39 *(.ini_array.*) 40 } 41 .dynamic : { 42 *(.dynamic) 43 } 44 .got : { 45 *(.got) 46 } 47 .got.plt : { 48 *(.got.plt) 49 } 50 /* Align the rest of segments on the page boundary to prevent 51 * GNU_RELRO segment from mprotecting writable flag away 52 * from them. See also http://b/261807330. 53 */ 54 . = ALIGN(4096); 55} 56