diff options
75 files changed, 743 insertions, 673 deletions
diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x index b623811..04d195b 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x @@ -1,5 +1,6 @@ /* Default linker script, for normal executables */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Modified for Android. */ +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +8,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +95,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +151,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)) } @@ -176,7 +181,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +190,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) } @@ -238,5 +242,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xbn b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xbn index 8f09a4b..4a05e8a 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xbn +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xbn @@ -1,5 +1,5 @@ /* Script for -N: mix text and data on same page; don't align data */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ + /* 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. */ . = .; /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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 = .); /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } @@ -236,5 +239,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xc b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xc index 3001520..2aa9174 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xc +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xc @@ -1,5 +1,5 @@ /* Script for -z combreloc: combine and sort reloc sections */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xd b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xd index 8daff5d..a49e267 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xd +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xd @@ -1,5 +1,5 @@ /* Script for ld -pie: link position independent executable */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -176,7 +180,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +189,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) } @@ -238,5 +241,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdc b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdc index f84efc9..f90f0b3 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdc +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdc @@ -1,5 +1,5 @@ /* Script for -pie -z combreloc: position independent executable, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdw b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdw index ae9272a..056f45a 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdw +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xdw @@ -1,5 +1,5 @@ /* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xn b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xn index a0486b8..5e64b79 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xn +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xn @@ -1,5 +1,5 @@ /* Script for -n: mix text and data on same page */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -176,7 +180,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +189,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) } @@ -238,5 +241,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xr b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xr index ce3d5f2..d48d4ec 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xr +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xr @@ -1,5 +1,5 @@ /* Script for ld -r: link without relocation */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -82,24 +82,26 @@ SECTIONS .rodata1 0 : { *(.rodata1) } .ARM.extab 0 : { *(.ARM.extab) } .ARM.exidx 0 : { *(.ARM.exidx) } - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges 0 : 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. */ + /* 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. */ /* Exception handling */ - .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* Thread Local Storage sections */ .tdata 0 : { *(.tdata) } .tbss 0 : { *(.tbss) } + /* 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. */ .preinit_array 0 : { KEEP (*(.preinit_array)) @@ -119,9 +121,7 @@ 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. */ + .bss section disappears because there are no input sections. */ } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xs b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xs index d131b99..ef80780 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xs +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xs @@ -1,5 +1,5 @@ /* Script for ld --shared: link shared library */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -90,38 +89,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -135,20 +139,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)) } @@ -165,7 +169,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -175,17 +178,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) } @@ -227,5 +230,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc index c5bf725..fcc8641 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc @@ -1,5 +1,6 @@ /* Script for --shared -z combreloc: shared library, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Modified for Android. */ +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +8,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -89,38 +89,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -134,20 +139,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)) } @@ -164,7 +169,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -174,17 +178,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) } @@ -226,5 +230,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsw b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsw index 10edd2f..c89c021 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsw +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsw @@ -1,5 +1,5 @@ /* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -89,38 +88,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -134,20 +138,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)) } @@ -164,7 +168,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -174,17 +177,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) } @@ -226,5 +229,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xu b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xu index 5758213..52d639e 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xu +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xu @@ -1,5 +1,5 @@ /* Script for ld -Ur: link w/out relocation, do create constructors */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -82,24 +82,26 @@ SECTIONS .rodata1 0 : { *(.rodata1) } .ARM.extab 0 : { *(.ARM.extab) } .ARM.exidx 0 : { *(.ARM.exidx) } - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges 0 : 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. */ + /* 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. */ /* Exception handling */ - .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* Thread Local Storage sections */ .tdata 0 : { *(.tdata) } .tbss 0 : { *(.tbss) } + /* 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. */ .preinit_array 0 : { KEEP (*(.preinit_array)) @@ -120,9 +122,7 @@ 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. */ + .bss section disappears because there are no input sections. */ } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xw b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xw index 9a32ad4..f7418bd 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xw +++ b/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xw @@ -1,5 +1,5 @@ /* Script for -z combreloc -z now -z relro: combine and sort reloc sections */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.x b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.x index 4ba4bbf..80f3ea8 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.x +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.x @@ -1,5 +1,6 @@ /* Default linker script, for normal executables */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Modified for Android. */ +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +8,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +95,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +151,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)) } @@ -176,7 +181,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +190,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) } @@ -238,5 +242,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xbn b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xbn index 4b0dee0..fdda7f3 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xbn +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xbn @@ -1,5 +1,5 @@ /* Script for -N: mix text and data on same page; don't align data */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ + /* 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. */ . = .; /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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 = .); /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } @@ -236,5 +239,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xc b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xc index 64a6c64..1bf56a2 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xc +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xc @@ -1,5 +1,5 @@ /* Script for -z combreloc: combine and sort reloc sections */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xd b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xd index f6b79bb..2600399 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xd +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xd @@ -1,5 +1,5 @@ /* Script for ld -pie: link position independent executable */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -176,7 +180,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +189,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) } @@ -238,5 +241,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdc b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdc index 40c1dd1..c1b5373 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdc +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdc @@ -1,5 +1,5 @@ /* Script for -pie -z combreloc: position independent executable, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdw b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdw index 6c74315..bf01d44 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdw +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xdw @@ -1,5 +1,5 @@ /* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xn b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xn index b52068e..cc38f15 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xn +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xn @@ -1,5 +1,5 @@ /* Script for -n: mix text and data on same page */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -95,45 +94,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -146,20 +150,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)) } @@ -176,7 +180,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -186,17 +189,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) } @@ -238,5 +241,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xr b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xr index e915989..c3b0497 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xr +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xr @@ -1,5 +1,5 @@ /* Script for ld -r: link without relocation */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -82,24 +82,26 @@ SECTIONS .rodata1 0 : { *(.rodata1) } .ARM.extab 0 : { *(.ARM.extab) } .ARM.exidx 0 : { *(.ARM.exidx) } - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges 0 : 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. */ + /* 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. */ /* Exception handling */ - .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* Thread Local Storage sections */ .tdata 0 : { *(.tdata) } .tbss 0 : { *(.tbss) } + /* 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. */ .preinit_array 0 : { KEEP (*(.preinit_array)) @@ -119,9 +121,7 @@ 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. */ + .bss section disappears because there are no input sections. */ } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xs b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xs index f223741..ec4930d 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xs +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xs @@ -1,5 +1,5 @@ /* Script for ld --shared: link shared library */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -90,38 +89,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -135,20 +139,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)) } @@ -165,7 +169,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -175,17 +178,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) } @@ -227,5 +230,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsc b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsc index e0576aa..f2a0b09 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsc +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsc @@ -1,5 +1,6 @@ /* Script for --shared -z combreloc: shared library, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Modified for Android. */ +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +8,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -89,38 +89,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -134,20 +139,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)) } @@ -164,7 +169,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -174,17 +178,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) } @@ -226,5 +230,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsw b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsw index b88b7e2..aaab571 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsw +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xsw @@ -1,5 +1,5 @@ /* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ - . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; + . = 0 + SIZEOF_HEADERS; .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } @@ -89,38 +88,43 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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); .preinit_array : { KEEP (*(.preinit_array)) } .init_array : { + 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)) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors)) } .fini_array : { + 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)) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors)) } .ctors : { @@ -134,20 +138,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)) } @@ -164,7 +168,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -174,17 +177,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) } @@ -226,5 +229,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xu b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xu index 0d24384..7de1661 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xu +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xu @@ -1,5 +1,5 @@ /* Script for ld -Ur: link w/out relocation, do create constructors */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -82,24 +82,26 @@ SECTIONS .rodata1 0 : { *(.rodata1) } .ARM.extab 0 : { *(.ARM.extab) } .ARM.exidx 0 : { *(.ARM.exidx) } - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges 0 : 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. */ + /* 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. */ /* Exception handling */ - .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* Thread Local Storage sections */ .tdata 0 : { *(.tdata) } .tbss 0 : { *(.tbss) } + /* 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. */ .preinit_array 0 : { KEEP (*(.preinit_array)) @@ -120,9 +122,7 @@ 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. */ + .bss section disappears because there are no input sections. */ } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xw b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xw index 6573384..f9550bf 100644 --- a/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xw +++ b/arm-linux-androideabi/lib/ldscripts/armelfb_linux_eabi.xw @@ -1,5 +1,5 @@ /* Script for -z combreloc -z now -z relro: combine and sort reloc sections */ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -7,11 +7,10 @@ OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) -SEARCH_DIR("=/tmp/80f89db8c39ef6ce3645d1cbd536a206/arm-linux-androideabi/lib"); 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", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS; + PROVIDE (__executable_start = 0x00010000); . = 0x00010000 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -94,45 +93,50 @@ SECTIONS PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .); - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } /* 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. */ - . = 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)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* 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 @@ -145,20 +149,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)) } @@ -175,7 +179,6 @@ SECTIONS } .data1 : { *(.data1) } _edata = .; PROVIDE (edata = .); - . = .; __bss_start = .; __bss_start__ = .; .bss : @@ -185,17 +188,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) } @@ -237,5 +240,5 @@ SECTIONS .debug_macro 0 : { *(.debug_macro) } .gnu.attributes 0 : { 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.*) } } diff --git a/arm-linux-androideabi/lib/libatomic.a b/arm-linux-androideabi/lib/libatomic.a Binary files differindex f69db03..4c06657 100644 --- a/arm-linux-androideabi/lib/libatomic.a +++ b/arm-linux-androideabi/lib/libatomic.a diff --git a/arm-linux-androideabi/lib/libgfortran.a b/arm-linux-androideabi/lib/libgfortran.a Binary files differindex 8d9d16e..d4e3622 100644 --- a/arm-linux-androideabi/lib/libgfortran.a +++ b/arm-linux-androideabi/lib/libgfortran.a diff --git a/arm-linux-androideabi/lib/libgomp-plugin-host_nonshm.a b/arm-linux-androideabi/lib/libgomp-plugin-host_nonshm.a Binary files differindex 032527e..73d06b8 100644 --- a/arm-linux-androideabi/lib/libgomp-plugin-host_nonshm.a +++ b/arm-linux-androideabi/lib/libgomp-plugin-host_nonshm.a diff --git a/arm-linux-androideabi/lib/libgomp.a b/arm-linux-androideabi/lib/libgomp.a Binary files differindex 5d32b60..788e2dd 100644 --- a/arm-linux-androideabi/lib/libgomp.a +++ b/arm-linux-androideabi/lib/libgomp.a diff --git a/arm-linux-androideabi/lib/libobjc.a b/arm-linux-androideabi/lib/libobjc.a Binary files differindex 52dbbee..96004e2 100644 --- a/arm-linux-androideabi/lib/libobjc.a +++ b/arm-linux-androideabi/lib/libobjc.a diff --git a/bin/arm-linux-androideabi-addr2line b/bin/arm-linux-androideabi-addr2line Binary files differindex 61e61f2..fe3a7b3 100755 --- a/bin/arm-linux-androideabi-addr2line +++ b/bin/arm-linux-androideabi-addr2line diff --git a/bin/arm-linux-androideabi-ar b/bin/arm-linux-androideabi-ar Binary files differindex 2112e8c..db24066 100755 --- a/bin/arm-linux-androideabi-ar +++ b/bin/arm-linux-androideabi-ar diff --git a/bin/arm-linux-androideabi-as b/bin/arm-linux-androideabi-as Binary files differindex 06770cc..a39aa36 100755 --- a/bin/arm-linux-androideabi-as +++ b/bin/arm-linux-androideabi-as diff --git a/bin/arm-linux-androideabi-c++filt b/bin/arm-linux-androideabi-c++filt Binary files differindex 7d3d97c..82998ab 100755 --- a/bin/arm-linux-androideabi-c++filt +++ b/bin/arm-linux-androideabi-c++filt diff --git a/bin/arm-linux-androideabi-cpp b/bin/arm-linux-androideabi-cpp Binary files differindex 7c1de9a..342cf6a 100755 --- a/bin/arm-linux-androideabi-cpp +++ b/bin/arm-linux-androideabi-cpp diff --git a/bin/arm-linux-androideabi-dwp b/bin/arm-linux-androideabi-dwp Binary files differindex 5ed700a..2b71930 100755 --- a/bin/arm-linux-androideabi-dwp +++ b/bin/arm-linux-androideabi-dwp diff --git a/bin/arm-linux-androideabi-elfedit b/bin/arm-linux-androideabi-elfedit Binary files differindex 4e0cb35..87c99e9 100755 --- a/bin/arm-linux-androideabi-elfedit +++ b/bin/arm-linux-androideabi-elfedit diff --git a/bin/arm-linux-androideabi-g++ b/bin/arm-linux-androideabi-g++ Binary files differindex 2ea5359..f2ce368 100755 --- a/bin/arm-linux-androideabi-g++ +++ b/bin/arm-linux-androideabi-g++ diff --git a/bin/arm-linux-androideabi-gcc b/bin/arm-linux-androideabi-gcc Binary files differindex beaeab6..9055aa9 100755 --- a/bin/arm-linux-androideabi-gcc +++ b/bin/arm-linux-androideabi-gcc diff --git a/bin/arm-linux-androideabi-gcc-5.4.1 b/bin/arm-linux-androideabi-gcc-5.4.1 Binary files differindex beaeab6..9055aa9 100755 --- a/bin/arm-linux-androideabi-gcc-5.4.1 +++ b/bin/arm-linux-androideabi-gcc-5.4.1 diff --git a/bin/arm-linux-androideabi-gcc-ar b/bin/arm-linux-androideabi-gcc-ar Binary files differindex 1930a33..5894b0e 100755 --- a/bin/arm-linux-androideabi-gcc-ar +++ b/bin/arm-linux-androideabi-gcc-ar diff --git a/bin/arm-linux-androideabi-gcc-nm b/bin/arm-linux-androideabi-gcc-nm Binary files differindex 2ef3c2a..50169c9 100755 --- a/bin/arm-linux-androideabi-gcc-nm +++ b/bin/arm-linux-androideabi-gcc-nm diff --git a/bin/arm-linux-androideabi-gcc-ranlib b/bin/arm-linux-androideabi-gcc-ranlib Binary files differindex 81d16f9..a31242f 100755 --- a/bin/arm-linux-androideabi-gcc-ranlib +++ b/bin/arm-linux-androideabi-gcc-ranlib diff --git a/bin/arm-linux-androideabi-gfortran b/bin/arm-linux-androideabi-gfortran Binary files differindex e4ec26a..c52121c 100755 --- a/bin/arm-linux-androideabi-gfortran +++ b/bin/arm-linux-androideabi-gfortran diff --git a/bin/arm-linux-androideabi-gprof b/bin/arm-linux-androideabi-gprof Binary files differindex d0fa19c..ed436f0 100755 --- a/bin/arm-linux-androideabi-gprof +++ b/bin/arm-linux-androideabi-gprof diff --git a/bin/arm-linux-androideabi-ld.bfd b/bin/arm-linux-androideabi-ld.bfd Binary files differindex 75a58b6..19dc958 100755 --- a/bin/arm-linux-androideabi-ld.bfd +++ b/bin/arm-linux-androideabi-ld.bfd diff --git a/bin/arm-linux-androideabi-ld.gold b/bin/arm-linux-androideabi-ld.gold Binary files differindex e8795a6..0578fea 100755 --- a/bin/arm-linux-androideabi-ld.gold +++ b/bin/arm-linux-androideabi-ld.gold diff --git a/bin/arm-linux-androideabi-nm b/bin/arm-linux-androideabi-nm Binary files differindex 6aaa9b7..d005e3d 100755 --- a/bin/arm-linux-androideabi-nm +++ b/bin/arm-linux-androideabi-nm diff --git a/bin/arm-linux-androideabi-objcopy b/bin/arm-linux-androideabi-objcopy Binary files differindex 343aa93..e0f8d31 100755 --- a/bin/arm-linux-androideabi-objcopy +++ b/bin/arm-linux-androideabi-objcopy diff --git a/bin/arm-linux-androideabi-objdump b/bin/arm-linux-androideabi-objdump Binary files differindex 4929f43..dfad542 100755 --- a/bin/arm-linux-androideabi-objdump +++ b/bin/arm-linux-androideabi-objdump diff --git a/bin/arm-linux-androideabi-ranlib b/bin/arm-linux-androideabi-ranlib Binary files differindex 66b74e2..ca02f8e 100755 --- a/bin/arm-linux-androideabi-ranlib +++ b/bin/arm-linux-androideabi-ranlib diff --git a/bin/arm-linux-androideabi-readelf b/bin/arm-linux-androideabi-readelf Binary files differindex b8a3bea..136b089 100755 --- a/bin/arm-linux-androideabi-readelf +++ b/bin/arm-linux-androideabi-readelf diff --git a/bin/arm-linux-androideabi-size b/bin/arm-linux-androideabi-size Binary files differindex 8570414..21a78d0 100755 --- a/bin/arm-linux-androideabi-size +++ b/bin/arm-linux-androideabi-size diff --git a/bin/arm-linux-androideabi-strings b/bin/arm-linux-androideabi-strings Binary files differindex 8fdf56b..35db629 100755 --- a/bin/arm-linux-androideabi-strings +++ b/bin/arm-linux-androideabi-strings diff --git a/bin/arm-linux-androideabi-strip b/bin/arm-linux-androideabi-strip Binary files differindex b579dc8..1ba3ea4 100755 --- a/bin/arm-linux-androideabi-strip +++ b/bin/arm-linux-androideabi-strip diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtbegin.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtbegin.o Binary files differindex 8930fcb..7e0d32d 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtbegin.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtbegin.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginS.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginS.o Binary files differindex 09e4da8..bbb6408 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginS.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginS.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginT.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginT.o Binary files differindex 8930fcb..7e0d32d 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginT.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtbeginT.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtend.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtend.o Binary files differindex c9a58c4..b2bb3dd 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtend.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtend.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtendS.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtendS.o Binary files differindex c9a58c4..b2bb3dd 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtendS.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtendS.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/crtfastmath.o b/lib/gcc/arm-linux-androideabi/5.4.1/crtfastmath.o Binary files differindex bd06e4e..e5a3256 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/crtfastmath.o +++ b/lib/gcc/arm-linux-androideabi/5.4.1/crtfastmath.o diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/include-fixed/linux/a.out.h b/lib/gcc/arm-linux-androideabi/5.4.1/include-fixed/linux/a.out.h index d2fe6fb..befa03b 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/include-fixed/linux/a.out.h +++ b/lib/gcc/arm-linux-androideabi/5.4.1/include-fixed/linux/a.out.h @@ -2,7 +2,7 @@ It has been auto-edited by fixincludes from: - "/tmp/80f89db8c39ef6ce3645d1cbd536a206/sysroot/usr/include/linux/a.out.h" + "/tmp/48e513624f4a815020abe7ac06c3e4a3/sysroot/usr/include/linux/a.out.h" This had to be done to correct non-standard usages in the original, manufacturer supplied header file. */ diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/libcaf_single.a b/lib/gcc/arm-linux-androideabi/5.4.1/libcaf_single.a Binary files differindex 85fd014..1637252 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/libcaf_single.a +++ b/lib/gcc/arm-linux-androideabi/5.4.1/libcaf_single.a diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/libgcc.a b/lib/gcc/arm-linux-androideabi/5.4.1/libgcc.a Binary files differindex 7592d00..d627ee9 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/libgcc.a +++ b/lib/gcc/arm-linux-androideabi/5.4.1/libgcc.a diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/libgcov.a b/lib/gcc/arm-linux-androideabi/5.4.1/libgcov.a Binary files differindex 72f53d1..d242008 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/libgcov.a +++ b/lib/gcc/arm-linux-androideabi/5.4.1/libgcov.a diff --git a/lib/gcc/arm-linux-androideabi/5.4.1/libgfortranbegin.a b/lib/gcc/arm-linux-androideabi/5.4.1/libgfortranbegin.a Binary files differindex 1b6bab6..d9f6be2 100644 --- a/lib/gcc/arm-linux-androideabi/5.4.1/libgfortranbegin.a +++ b/lib/gcc/arm-linux-androideabi/5.4.1/libgfortranbegin.a diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1 b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1 Binary files differindex 55e2b7b..d0e2bac 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1 +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1 diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1obj b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1obj Binary files differindex 9a0540b..342363c 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1obj +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1obj diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1objplus b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1objplus Binary files differindex 90c909e..5661592 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1objplus +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1objplus diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1plus b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1plus Binary files differindex 3307c8e..1d7ae6a 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/cc1plus +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/cc1plus diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/collect2 b/libexec/gcc/arm-linux-androideabi/5.4.1/collect2 Binary files differindex 4212b01..219c980 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/collect2 +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/collect2 diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/f951 b/libexec/gcc/arm-linux-androideabi/5.4.1/f951 Binary files differindex 570ff3b..0ecf18d 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/f951 +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/f951 diff --git a/libexec/gcc/arm-linux-androideabi/5.4.1/lto1 b/libexec/gcc/arm-linux-androideabi/5.4.1/lto1 Binary files differindex f9f4f33..909a4d8 100755 --- a/libexec/gcc/arm-linux-androideabi/5.4.1/lto1 +++ b/libexec/gcc/arm-linux-androideabi/5.4.1/lto1 @@ -1,16 +1,16 @@ -platform/bionic 112be469bb0671f19f4f61e021693595384142fa +platform/bionic 36ad0207d67ef395b003dbf75d2c0193d3b8e093 platform/development ddc353fb83f96518c8d9a8926b2765d2d6b38f18 platform/external/googletest 013ee6fccb6bb9ebd6215b504f0eef45dccfde4e platform/external/libcxx 3e4971a3afe8f7d23e085e6834f02f847047778a platform/external/libcxxabi 9711d72e91f48830db3f4e8133d1e2e328e8504c platform/external/libunwind_llvm fecc6f26cfdbfc9cf0ea2021629ac6e85b7c0113 platform/external/llvm 4a8570c741b7b1ecc5176f420073c022aef75136 -platform/external/shaderc/glslang c1ccd4bf91d665a19c7ed2694fe65bf1738a6845 -platform/external/shaderc/shaderc 08f8e49598711f107422b6027c26d6957a241e1d -platform/external/shaderc/spirv-headers 0ed5060aff573ae7de6cba252da540d938cddd0d -platform/external/shaderc/spirv-tools ed0b8866c47b26c9fe2a728b73392f6baefa2158 +platform/external/shaderc/glslang 9fc206608c21434e765daaca7c52410f60263bfa +platform/external/shaderc/shaderc 74e923f8b61f67c45eac3b5835a24974308a17d6 +platform/external/shaderc/spirv-headers 5cfb387e0b49161698b0676b1d359c120bee4819 +platform/external/shaderc/spirv-tools 5cf6c6c0233f3597c35e5886e541531a5bcaf3ed platform/external/vulkan-validation-layers 99341848129a0a17e024a7395aac6fa8eec9b578 -platform/ndk 7d0ac015bb219761c53af6ddbb74b32d7eb23ba8 +platform/ndk cf72894c1a41c1c83f43ff955ebf90783f47fb48 platform/prebuilts/clang/host/darwin-x86 385e136997ff850bb6c0d7428146f0671d0748ef platform/prebuilts/clang/host/linux-x86 5fa33af083226aa7771ba38abae0631ed84bee48 platform/prebuilts/clang/host/windows-x86 90efd850fcd95bfdd9945e4c0e90e4cb396d2a6c |