search for: _start

Displaying 20 results from an estimated 846 matches for "_start".

Did you mean: start
2018 Jun 05
2
lld mishandling R_X86_64_PC32 relocations
...opy on a relocatable i386 ELF object file to convert it to x86_64 which transforms a R_386_PC32 into a R_X86_64_PC32. Steps to reproduce: 1. Assemble the attached bug.asm using nasm and note the R_386_PC32 REL. $ nasm -felf32 -o bug.o bug.asm $ x86_64-elf-objdump -dr bug.o | grep -A1 -e '<_start>:' 00000000 <_start>: 0: e8 fc ff ff ff call 1 <_start+0x1> $ x86_64-elf-readelf -r bug.o Relocation section '.rel.text._start' at offset 0x260 contains 1 entry: Offset Info Type Sym.Value Sym. Name 00000001 00000302 R_386_PC32 000...
2013 Dec 03
0
[klibc:master] ppc64: Add ppc64le support
...r/klibc/arch/ppc64/crt0.S b/usr/klibc/arch/ppc64/crt0.S index c976d5c..ed14534 100644 --- a/usr/klibc/arch/ppc64/crt0.S +++ b/usr/klibc/arch/ppc64/crt0.S @@ -9,25 +9,35 @@ # } # - .section ".toc","aw" -.LC0: .tc environ[TC],environ - .text - .align 4 - + .balign 4 + .globl _start +#if _CALL_ELF == 2 + .type _start, at function +_start: +#else .section ".opd","aw" + .balign 8 _start: .quad ._start, .TOC. at tocbase, 0 .previous - .size _start, 24 .type ._start, at function - .globl _start - .globl ._start ._start: - stdu %r1,-32(%r1) - addi...
2013 Dec 03
2
[PATCH 1/2] ppc64: Add ppc64le support
...r/klibc/arch/ppc64/crt0.S b/usr/klibc/arch/ppc64/crt0.S index c976d5c..250a84a 100644 --- a/usr/klibc/arch/ppc64/crt0.S +++ b/usr/klibc/arch/ppc64/crt0.S @@ -9,25 +9,35 @@ # } # - .section ".toc","aw" -.LC0: .tc environ[TC],environ - .text - .align 4 - + .balign 4 + .globl _start +#if _CALL_ELF == 2 + .type _start, at function +_start: +#else .section ".opd","aw" + .balign 8 _start: .quad ._start, .TOC. at tocbase, 0 .previous - .size _start, 24 .type ._start, at function - .globl _start - .globl ._start ._start: - stdu %r1,-32(%r1) - addi...
2019 Apr 04
3
question about --emit-relocs with lld
Hi, While doing Linux kernel builds linked with lld, I've tracked down a difference that breaks relocation of the kernel image (e.g. under KASLR[1]). Some relocations are changed to ABS (weirdly, all are in .rodata section). Note the difference below in the resulting linked output. .L__const._start.instance becomes *ABS* only under lld: $ cat minimal.c struct minimal { void *pointer; int value; }; void _start(void) { struct minimal instance = { .value = 1, }; } $ llvm-build/x86/bin/clang -c minimal.c $ /usr/bin/ld.bfd --emit-relocs minimal.o -...
2003 Nov 28
2
[PATCH] update crt0.S on ppc32
The _start stuff was changed some time ago, but ppc was not updated. This fixes klibc for me. I'm not sure what to do with the second arg to __libc_init, so I set it to 0.. However, looking at other static binaries, there is more stuff todo. diff -p -purNx linux -x '.*.d' -x syscalls -x socketca...
2009 Jun 30
1
multiple definition of `_start' when using -ld with klcc
Hi, I am trying to setup an environment where I can build external projects against klibc. It works - except if I have a program that links to libc. Then I get a multiple definition of `_start' message. Here is a simple test case. Jon [ringlej at ringlejxbuild ~/temp/klibc-test]$ cat klibc-test.c #include <stdio.h> int main(void) { printf("hello world"); } [ringlej at ringlejxbuild ~/temp/klibc-test]$ CC=klcc LD=klcc LDFLAGS="-lc" make klibc-test...
2018 Apr 26
2
windows ABI problem with i128?
...m:console kernel32.lib /nologo And run it, it triggers the breakpoint. Meanwhile on linux, this test passes. I suspect it may be a calling convention issue. Here is the assembly for the linux x86_64 version: ================================================================= 0000000000000010 <_start>: 10: 55 push %rbp 11: 48 89 e5 mov %rsp,%rbp 14: 48 83 ec 40 sub $0x40,%rsp 18: 48 b8 14 30 27 ec 01 movabs $0x1ec273014,%rax 1f: 00 00 00 22: 48 89 45 f8 mov %rax,-0x8(%rbp) 26: 48...
2018 Apr 26
0
windows ABI problem with i128?
...t, it triggers the breakpoint. > > Meanwhile on linux, this test passes. > > I suspect it may be a calling convention issue. Here is the assembly for the > linux x86_64 version: > > > ================================================================= > 0000000000000010 <_start>: > 10: 55 push %rbp > 11: 48 89 e5 mov %rsp,%rbp > 14: 48 83 ec 40 sub $0x40,%rsp > 18: 48 b8 14 30 27 ec 01 movabs $0x1ec273014,%rax > 1f: 00 00 00 > 22: 48 89 45 f8 mov...
2018 Apr 26
1
windows ABI problem with i128?
...Meanwhile on linux, this test passes. > > > > I suspect it may be a calling convention issue. Here is the assembly for > the > > linux x86_64 version: > > > > > > ================================================================= > > 0000000000000010 <_start>: > > 10: 55 push %rbp > > 11: 48 89 e5 mov %rsp,%rbp > > 14: 48 83 ec 40 sub $0x40,%rsp > > 18: 48 b8 14 30 27 ec 01 movabs $0x1ec273014,%rax > > 1f: 00 00 00 > > 22:...
2006 Jan 08
0
[PATCH] Fix DT_FINI function pass-in to _start on parisc
...le it's unlikely to be used, doing the right thing is good. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org> diff --git a/klibc/arch/parisc/crt0.S b/klibc/arch/parisc/crt0.S index 7428443..a9b6e96 100644 --- a/klibc/arch/parisc/crt0.S +++ b/klibc/arch/parisc/crt0.S @@ -25,8 +25,8 @@ _start: ldil L%$global$, %dp ldo R%$global$(%dp), %dp -/* Indicate that we don't need no stinkin' atexit callback */ - ldi 0,%r25 +/* parisc abi puts the atexit pointer in %r23, see ELF_PLAT_INIT() */ + copy %r23, %r25 /* branch to __libc_init */ bl __libc_init,%r2
2017 May 03
2
Help with setting up ARM embedded clang + lld
On 2 May 2017 at 23:59, Rui Ueyama <ruiu at google.com> wrote: > That's interesting. Usually your code wouldn't be gc'ed because your entire > code is reachable from _start. Baremetal doesn't need a _start. > Does your program depend on the feature that, if no -e option is given, the > linker sets the beginning of the .text section to the entry point address? I believe that would help, yes. But there may be linker scripts that can change that, so you nee...
2019 Mar 08
1
[RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address
...gt; > > > { > > > > I also wonder here: when page is write protected then > > > > it does not look like .invalidate_range is invoked. > > > > > > > > E.g. mm/ksm.c calls > > > > > > > > mmu_notifier_invalidate_range_start and > > > > mmu_notifier_invalidate_range_end but not mmu_notifier_invalidate_range. > > > > > > > > Similarly, rmap in page_mkclean_one will not call > > > > mmu_notifier_invalidate_range. > > > > > > > > If I'm right vh...
2019 Mar 08
1
[RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address
...gt; > > > { > > > > I also wonder here: when page is write protected then > > > > it does not look like .invalidate_range is invoked. > > > > > > > > E.g. mm/ksm.c calls > > > > > > > > mmu_notifier_invalidate_range_start and > > > > mmu_notifier_invalidate_range_end but not mmu_notifier_invalidate_range. > > > > > > > > Similarly, rmap in page_mkclean_one will not call > > > > mmu_notifier_invalidate_range. > > > > > > > > If I'm right vh...
2000 Dec 12
1
openssh 2.3.0p1 crashes
...486/bits/string.h:435 #1 0x400bf87d in _IO_getline (fp=0x80de3d0, buf=0xbfffe834 "?\e\017\b?\e\017\b(", n=1023, delim=10, extract_delim=1) at iogetline.c:39 #2 0x400be938 in _IO_fgets (buf=0xbfffe834 "?\e\017\b?\e\017\b(", n=1024, fp=0x80de3d0) at iofgets.c:48 #3 0x804de09 in _start () #4 0x804e1f9 in _start () #5 0x804efb5 in _start () #6 0x804e4bd in _start () #7 0x804cb84 in _start () (gdb) quit strace says: [...] 3295 write(2, "Waiting for server public key.\r\n", 32) = 32 3295 select(5, [4], NULL, NULL, NULL) = 1 (in [4]) 3295 read(4, "\0\0\1\v\0\...
2017 Jul 12
5
[LLD] Linker Relaxation
...e they are written out. This works but isn't optimal. Since we intend to contribute this target back to upstream later on, we'd like to discuss how this should be properly handled. Note that RISC-V also handles alignment as part of relaxation, so it isn't really optional. For example: _start: mv a0, a0 .p2align 2 li a0, 0 The assembler inserts a 3-byte padding (note: this behavior isn't merged yet, see: https://github.com/riscv/riscv-binutils-gdb/pull/88): 00000000 <_start>: 0: 852a mv a0,a0 2: 00 01 00...
2016 Apr 05
3
What should IRObjectFile expose?
...Rafael, There's a source file in Chromium that does something like this: target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" module asm ".text" module asm "foo: ret" declare void @foo() define void @_start() { call void @foo() ret void } Currently the llvm-nm output for that looks like this: ---------------- T _start U foo ---------------- t foo That second entry is a bug, right? I just wanted to confirm before I go ahead and fix it, since the fix seems like it would be rather...
2014 Jul 28
2
[LLVMdev] [lld] question on ELF section formating
I've been adding ELF/AArch64 support to lld based off the existing x86_64 code that is already there in lld. I've been able to compile and link a simple "Hello World"-type program. However, I'm getting what appears to be a misplacement/name change of the _start atom. When I do the link, the _start section gets named __tls_get_addr. The code inside this section appears to be correct, just the name is wrong. If I output in YAML, it appears to have the correct name. Since I know this is new code that no one has seen, I was just wondering if anyone might...
2013 Oct 10
2
[LLVMdev] [lld] Handling a whole bunch of readers
...ML object file for example), so what do you think is the >> benefit of depending on special file magic compared to using file >> extension? >> >> >> I would like to support usecases like this. > > (a) > $ cat simple.s > .text > .global _start > .type _start, at function > _start: > callq bar > ret > > clang simple.s -c- -o- | lld -flavor gnu -target x86_64 > --output-filetype=yaml -r - | lld -flavor gnu -target x86_64 - > > Which is certainly not doable because you dont have a file c...
2019 Mar 07
3
[RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address
...truct vhost_virtqueue **vqs, int nvqs, int iov_limit) > > > { > > > > I also wonder here: when page is write protected then > > it does not look like .invalidate_range is invoked. > > > > E.g. mm/ksm.c calls > > > > mmu_notifier_invalidate_range_start and > > mmu_notifier_invalidate_range_end but not mmu_notifier_invalidate_range. > > > > Similarly, rmap in page_mkclean_one will not call > > mmu_notifier_invalidate_range. > > > > If I'm right vhost won't get notified when page is write-protected sinc...
2019 Mar 07
3
[RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address
...truct vhost_virtqueue **vqs, int nvqs, int iov_limit) > > > { > > > > I also wonder here: when page is write protected then > > it does not look like .invalidate_range is invoked. > > > > E.g. mm/ksm.c calls > > > > mmu_notifier_invalidate_range_start and > > mmu_notifier_invalidate_range_end but not mmu_notifier_invalidate_range. > > > > Similarly, rmap in page_mkclean_one will not call > > mmu_notifier_invalidate_range. > > > > If I'm right vhost won't get notified when page is write-protected sinc...