summaryrefslogtreecommitdiff
path: root/aarch64-linux-android/lib/ldscripts/aarch64linux32b.x
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-05-19 10:36:40 -0700
committerBen Cheng <bccheng@google.com>2014-05-19 10:36:40 -0700
commit11bd8c3410825767b40005e177361eb0b9be4297 (patch)
treecb28e05ace72d29294e44175be2d17b278895b41 /aarch64-linux-android/lib/ldscripts/aarch64linux32b.x
parent2ab936a874e2dced76b5cc37f6afc603825026c9 (diff)
downloadaarch64-linux-android-4.9-11bd8c3410825767b40005e177361eb0b9be4297.tar.gz
[darwin-x86] GCC 4.9 aarch64 prebuilt based on 051414 snapshot.
Change-Id: I9bcfe9849c5706623c82a2a7d5509d300c4746e7
Diffstat (limited to 'aarch64-linux-android/lib/ldscripts/aarch64linux32b.x')
-rw-r--r--aarch64-linux-android/lib/ldscripts/aarch64linux32b.x53
1 files changed, 30 insertions, 23 deletions
diff --git a/aarch64-linux-android/lib/ldscripts/aarch64linux32b.x b/aarch64-linux-android/lib/ldscripts/aarch64linux32b.x
index 797582b..ad6223b 100644
--- a/aarch64-linux-android/lib/ldscripts/aarch64linux32b.x
+++ b/aarch64-linux-android/lib/ldscripts/aarch64linux32b.x
@@ -1,13 +1,13 @@
/* Default linker script, for normal executables */
+/* Modified for Android. */
OUTPUT_FORMAT("elf32-bigaarch64", "elf32-bigaarch64",
"elf32-littleaarch64")
OUTPUT_ARCH(aarch64:ilp32)
ENTRY(_start)
-SEARCH_DIR("/tmp/toolchain-build-aarch64-linux-4.9/prefix/aarch64-linux-android/lib32"); SEARCH_DIR("=/usr/local/lib32"); SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
SECTIONS
{
/* Read-only sections, merged into text segment: */
- PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
+ PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
.interp : { *(.interp) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
.hash : { *(.hash) }
@@ -68,9 +68,9 @@ SECTIONS
/* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges : ONLY_IF_RO { *(.exception_ranges
.exception_ranges*) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+ /* Adjust the address for the data segment. For 32 bits we want to align
+ at exactly a page boundary to make life easier for apriori. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
@@ -78,26 +78,33 @@ SECTIONS
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ /* Ensure the __preinit_array_start label is properly aligned. We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty. */
+ . = ALIGN(32 / 8);
+ PROVIDE_HIDDEN (__preinit_array_start = .);
.preinit_array :
{
- PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
- PROVIDE_HIDDEN (__preinit_array_end = .);
}
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ PROVIDE_HIDDEN (__init_array_start = .);
.init_array :
{
- PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*crtbegin*.o(.init_array))
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
- KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
- PROVIDE_HIDDEN (__init_array_end = .);
+ KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors))
}
+ PROVIDE_HIDDEN (__init_array_end = .);
+ PROVIDE_HIDDEN (__fini_array_start = .);
.fini_array :
{
- PROVIDE_HIDDEN (__fini_array_start = .);
+ KEEP (*crtbegin*.o(.fini_array))
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
- KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
- PROVIDE_HIDDEN (__fini_array_end = .);
+ KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors))
}
+ PROVIDE_HIDDEN (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
@@ -110,20 +117,20 @@ SECTIONS
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
+ KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors :
{
KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
@@ -151,17 +158,17 @@ SECTIONS
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- . = ALIGN(. != 0 ? 32 / 8 : 1);
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(32 / 8);
}
_bss_end__ = . ; __bss_end__ = . ;
. = ALIGN(32 / 8);
. = SEGMENT_START("ldata-segment", .);
. = ALIGN(32 / 8);
__end__ = . ;
- _end = .; PROVIDE (end = .);
+ _end = .;
+ _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
+ PROVIDE (end = .);
. = DATA_SEGMENT_END (.);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@@ -203,5 +210,5 @@ SECTIONS
.debug_macro 0 : { *(.debug_macro) }
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
- /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.mdebug.*) }
}