Displaying 20 results from an estimated 21 matches for "preinit_array".
2019 Oct 14
2
[LLD] Placing more sections in same segment as data?
...ction more isolated than the gold or bfd linkers. For example, readelf -l applied to the "same" executable linked with those three linkers reveals the following under "Section to Segment mapping":
lld:
05 .data .got.plt .bss
gold:
03 .eh_frame .init_array .fini_array .preinit_array .dynamic .got .got.plt .data .bss
bfd:
05 .eh_frame .preinit_array .init_array .fini_array .dynamic .got .got.plt .data .bss
This separation seems to result in lld creating two LOAD RW segments whenever gold or bfd would create only one. For example, also from readelf -l output:
LOAD...
2019 Jan 18
0
[klibc:master] mips: use -Ttext-segment when linking shared library
...gnu.linkonce.s2.*) }
- .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
- .eh_frame_hdr : { *(.eh_frame_hdr) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN(8192);
- /* 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 (__preinit_array_start = .);
- .preinit_arr...
2015 Oct 05
0
[PATCH 2/4] Remove unused linker scripts
...AT(__rodata_lma) {
- HIDDEN(__rodata_start = .);
- *(.rodata)
- *(.rodata.*)
- HIDDEN(__rodata_end = .);
- }
-
- . = ALIGN(4);
-
- HIDDEN(__ctors_vma = .);
- HIDDEN(__ctors_lma = __ctors_vma + __text_lma - __text_vma);
- .ctors : AT(__ctors_lma) {
- HIDDEN(__ctors_start = .);
- KEEP (*(SORT(.preinit_array*)))
- KEEP (*(SORT(.init_array*)))
- KEEP (*(SORT(.ctors*)))
- HIDDEN(__ctors_end = .);
- }
-
- HIDDEN(__dtors_vma = .);
- HIDDEN(__dtors_lma = __dtors_vma + __text_lma - __text_vma);
- .dtors : AT(__dtors_lma) {
- HIDDEN(__dtors_start = .);
- KEEP (*(SORT(.fini_array*)))
- KEEP (*(SORT(.dtor...
2019 Jan 21
0
[PATCH] ia64: Fix shared build
....exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ /* Thread Local Storage sections */
+ .tdata :
+ {
+ PROVIDE_HIDDEN (__tdata_start = .);
+ *(.tdata .tdata.* .gnu.linkonce.td.*)
+ }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+...
2014 Sep 26
1
configure: error: linking to Fortran libraries from C fails
...gcc-4.9 -std=gnu99 -fsanitize=address -o conftest
-fno-omit-frame-pointer -O0 -g -Wall -pedantic -mtune=native
-I/usr/local/include -L/usr/local/lib conftest.c -ldl -lm
-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -lgfortran -lm -lquadmath >&5
/usr/lib/gcc/x86_64-linux-gnu/4.9/libasan_preinit.o:(.preinit_array+0x0): undefined
reference to `__asan_init_v3'
/tmp/cchWOhDV.o: In function `_GLOBAL__sub_I_00099_0__main':
/home/mdowle/R/Rtrunk/conftest.c:113: undefined reference to
`__asan_init_v3'
collect2: error: ld returned 1 exit status
configure:23682: $? = 1
configure: failed program was:
|...
2019 Jan 21
0
[klibc:master] ia64: Fix shared build
....exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ /* Thread Local Storage sections */
+ .tdata :
+ {
+ PROVIDE_HIDDEN (__tdata_start = .);
+ *(.tdata .tdata.* .gnu.linkonce.td.*)
+ }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+ PROVIDE_HIDDEN (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+ PROVIDE_HIDDEN (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+ PROVIDE_HIDDEN (__init_array_start = .);
+ KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+...
2012 Oct 02
0
[LLVMdev] lld Atoms from STT_SECTION type symbols.
...s should
be kept in the final output even if GC judges that it could be discarded.
Perhaps, at this moment, it would suffice to provide an option to
specify which sections must be kept. Additionally, perhaps the ELF
reader or writer could always keep the .init{.*,_array},
.fini{.*,_array} and preinit_array sections.
--
Evandro Menezes Austin, TX emenezes at codeaurora.org
Qualcomm Innovation Center, Inc is a member of the Code Aurora Forum
On 10/01/12 21:06, Sid Manning wrote:
>
> I committed a patch to update the ReaderELF.cpp that, in light of some
> recent changes in...
2012 Nov 01
1
[PATCH] com32: Include .init_array section in .ctors in linker script
...---
com32/lib/malloc.c | 1 -
3 files changed, 4 insertions(+), 27 deletions(-)
delete mode 100644 com32/lib/init.h
diff --git a/com32/lib/elf32.ld b/com32/lib/elf32.ld
index ddf6e04..16d10a3 100644
--- a/com32/lib/elf32.ld
+++ b/com32/lib/elf32.ld
@@ -75,17 +75,6 @@ SECTIONS
{
KEEP (*(.preinit_array))
}
- .init_array :
- {
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- }
- .fini_array :
- {
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- }
-
.ctors :
{
__ctors_start = .;
@@ -93,6 +82,8 @@ SECTIONS
KEEP (*(.ctors))...
2018 Mar 02
5
[PATCH 0/5] Various MIPS fixes
Hi,
I noticed that klibc started crashing on 64-bit MIPS and in my quest to fix the
bug I got a bit carried away and fixed a few other things as well. Here are
various miscellaneous MIPS patches, although the first patch is the important
one.
Thanks,
James
*** BLURB HERE ***
James Cowgill (5):
mips64: compile with -mno-abicalls
mips: use -Ttext-segment when linking shared library
2014 Mar 11
4
[PATCH] add mips64 support
...gnu.linkonce.s2.*) }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN(8192);
+ /* 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 (__preinit_array_start = .);
+ .preinit_arr...
2013 Sep 24
0
[LLVMdev] [ASan] static linking on android?
> Static runtime will only intercept calls from the main executable, but
> not from any libraries. This may work for simple standalone programs,
> but you may run into puzzling failures.
What type of failures do you mean? Does the symbol mismatch break
assumptions in the ASan runtime? It's easy to imagine, for example,
ASan missing use-after-free bugs because the call to free() is
2015 Oct 05
7
[PATCH 0/4] Improve linker scripts
From: Sylvain Gault <sylvain.gault at gmail.com>
These patches basically remove unused linker scripts and port a change that was
made to an unused script.
Those are to be applied on top of the gcc 5 bug fixes as they would conflict
otherwise.
Sylvain Gault (4):
diag/mbr: fix dependency to linker script
Remove unused linker scripts
core: Make symbols defined in linker script HIDDEN
2013 Sep 23
2
[LLVMdev] [ASan] static linking on android?
For the same reason we use shared runtime on OSX.
We intercept libc calls by declaring a function with the same name in
the sanitizer runtime library. Glibc loader puts main executable early
in the symbol lookup order, which lets us interpose symbols from
shared libraries with symbols from statically linked sanitizer
runtime. Android (and AFAIK most other platforms) does not allow that,
which is
2006 Jun 26
2
[klibc 28/43] mips support for klibc
...gnu.linkonce.s2.*) }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN(8192);
+ /* 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 (__preinit_array_start = .);
+ .preinit_arr...
2020 Jun 24
7
RFC: Sanitizer-based Heap Profiler
...ation pass calls this new
init function instead by a generated global constructor. It currently
additionally invokes __asan_init since we are leveraging a modified ASAN
runtime. Eventually, this should be changed to initialize refactored common
support.
Note that __asan init is also placed in the .preinit_array when it is
available, so it is invoked even earlier than global constructors.
Currently, it is not possible to do this for __heapprof_init, as it calls
timespec_get in order to get a baseline timestamp (as described in the
ChunkHeader comments the timestamps (ms) are actually offsets from the
basel...
2020 Jul 05
2
RFC: Sanitizer-based Heap Profiler
...ction instead by a generated global constructor. It currently
> additionally invokes __asan_init since we are leveraging a modified ASAN
> runtime. Eventually, this should be changed to initialize refactored common
> support.
>
>
>
> Note that __asan init is also placed in the .preinit_array when it is
> available, so it is invoked even earlier than global constructors.
> Currently, it is not possible to do this for __heapprof_init, as it calls
> timespec_get in order to get a baseline timestamp (as described in the
> ChunkHeader comments the timestamps (ms) are actually of...
2020 Jun 25
1
RFC: Sanitizer-based Heap Profiler
...unction instead by a generated global constructor. It
> currently additionally invokes __asan_init since we are leveraging a
> modified ASAN runtime. Eventually, this should be changed to
> initialize refactored common support.
>
>
> Note that __asan init is also placed in the .preinit_array when it is
> available, so it is invoked even earlier than global constructors.
> Currently, it is not possible to do this for __heapprof_init, as it
> calls timespec_get in order to get a baseline timestamp (as described
> in the ChunkHeader comments the timestamps (ms) are actuall...
2020 Jul 09
2
RFC: Sanitizer-based Heap Profiler
...ead by a generated global constructor. It currently
>> additionally invokes __asan_init since we are leveraging a modified ASAN
>> runtime. Eventually, this should be changed to initialize refactored common
>> support.
>>
>> Note that __asan init is also placed in the .preinit_array when it is
>> available, so it is invoked even earlier than global constructors.
>> Currently, it is not possible to do this for __heapprof_init, as it calls
>> timespec_get in order to get a baseline timestamp (as described in the
>> ChunkHeader comments the timestamps (ms)...
2012 Nov 02
10
[PATCH 0/9] elflink fixes
From: Matt Fleming <matt.fleming at intel.com>
Here are the patches that I've got queued up based on the very helpful
feedback I received from people testing Syslinux 5.00-pre9. Unless
anyone has any concerns these will make it into Syslinux 5.00-pre10.
Matt Fleming (9):
pxe: Don't call open_config() from the pxe core
ldlinux: Print a warning if no config file is found
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...*__safestack_get_safe_stack_ptr() {
+ return (char*) __builtin_frame_address(0) + 2*sizeof(void*);
+}
+
+#ifdef __linux__
+// Run safestack initialization before any other constructors
+// FIXME: can we do something similar on Mac or FreeBSD?
+extern "C" {
+__attribute__((section(".preinit_array"), used))
+void (*__llvm__safestack_preinit)(void) = __llvm__safestack_init;
+}
+#endif
+
+} // namespace __llvm__safestack
diff --git a/make/platform/clang_darwin.mk b/make/platform/clang_darwin.mk
index 8b5f848..7908b77 100644
--- a/make/platform/clang_darwin.mk
+++ b/make/platform/clang_dar...