Linker script nightmare -- please help! - Raspberry Pi Forums


hi all,

i've been suffering bug in linker script long time, , have no idea how fix or causes it.
here's linker script... (cut context, real thing longer, adds more sections.

code: select all

entry(bt_reset) _stack_size = defined(_stack_size) ? _stack_size : 0x100; _irq_stack_size = defined(_irq_stack_size) ? _irq_stack_size : 0x0; _abort_stack_size = defined(_abort_stack_size) ? _abort_stack_size : 0; _supervisor_stack_size = defined(_supervisor_stack_size) ? _supervisor_stack_size : 0; memory {  sram (rwx) : origin = 0x8000 + 0x0, length = 0x00100000 - 0x0 } sections {     .bt.init : {							// kernel head section. 		__bt_init_start = .;         keep(*(.bt.init))         keep(*(.bt.init*)) 		keep(*(.bt.init.vectors)) 		keep(*(.bt.init.vectors.*)) 		keep(*(.init)) 		__bt_init_end = .;     } > bt_linker_init_section      .bt.arch.init : { 	    __bt_arch_init_start = .; 		keep(*(.bt.arch.init)) 		keep(*(.bt.arch.init.*)) 		__bt_arch_init_end = .; 	} > bt_linker_init_section ... } 
problem .bt.arch.init overwrites .bt.init , have no idea why. subsequent sections work correctly.

heres list file...

code: select all

disassembly of section .bt.init:  00008000 <__bt_init_start>:     8000:       e59ff270        ldr     pc, [pc, #624]  ; 8278 <__gnu_ldivmod_helper+0xc>     8004:       e59ff018        ldr     pc, [pc, #24]   ; 8024 <__bt_init_start+0x24>     8008:       e59ff018        ldr     pc, [pc, #24]   ; 8028 <__bt_init_start+0x28>     800c:       e59ff018        ldr     pc, [pc, #24]   ; 802c <__bt_init_start+0x2c>     8010:       e59ff018        ldr     pc, [pc, #24]   ; 8030 <__bt_arch_init_end>     8014:       e59ff018        ldr     pc, [pc, #24]   ; 8034 <__bt_arch_init_end+0x4>     8018:       e59ff018        ldr     pc, [pc, #24]   ; 8038 <__bt_arch_init_end+0x8>     801c:       e59ff018        ldr     pc, [pc, #24]   ; 803c <__bt_arch_init_end+0xc>     8020:       00008080        andeq   r8, r0, r0, lsl #1     8024:       00008198        muleq   r0, r8, r1     8028:       000081cc        andeq   r8, r0, ip, asr #3     802c:       0000819c        muleq   r0, ip, r1     8030:       000081a8        andeq   r8, r0, r8, lsr #3     8034:       000081bc                        ; <undefined> instruction: 0x000081bc     8038:       0000b454        andeq   fp, r0, r4, asr r4     803c:       000081b8                        ; <undefined> instruction: 0x000081b8  00008040 <_bt_vector_second_table>:     8040:       e59ff230        ldr     pc, [pc, #560]  ; 8278 <__gnu_ldivmod_helper+0xc>     8044:       e59ff018        ldr     pc, [pc, #24]   ; 8064 <gpio_driver+0x4>     8048:       e59ff018        ldr     pc, [pc, #24]   ; 8068 <gpio_driver+0x8>     804c:       e59ff018        ldr     pc, [pc, #24]   ; 806c <gpio_driver+0xc>     8050:       e59ff018        ldr     pc, [pc, #24]   ; 8070 <__bt_arch_drivers_end>     8054:       e59ff018        ldr     pc, [pc, #24]   ; 8074 <__bt_arch_drivers_end+0x4>     8058:       e59ff018        ldr     pc, [pc, #24]   ; 8078 <__bt_loaders_end>     805c:       e59ff018        ldr     pc, [pc, #24]   ; 807c <__bt_loaders_end+0x4>     8060:       00008080        andeq   r8, r0, r0, lsl #1     8064:       00008198        muleq   r0, r8, r1     8068:       000081cc        andeq   r8, r0, ip, asr #3     806c:       0000819c        muleq   r0, ip, r1     8070:       000081a8        andeq   r8, r0, r8, lsr #3     8074:       000081bc                        ; <undefined> instruction: 0x000081bc     8078:       0000b454        andeq   fp, r0, r4, asr r4     807c:       000081b8                        ; <undefined> instruction: 0x000081b8  00008080 <bt_reset>:     8080:       e10f9000        mrs     r9, cpsr     8084:       e3899080        orr     r9, r9, #128    ; 0x80     8088:       e121f009        msr     cpsr_c, r9     808c:       e1a07001        mov     r7, r1     8090:       e1a08002        mov     r8, r2     8094:       e59f01e0        ldr     r0, [pc, #480]  ; 827c <__gnu_ldivmod_helper+0x10>     8098:       ee0c0f10        mcr     15, 0, r0, cr12, cr0, {0}     809c:       eb000047        bl      81c0 <_bt_startup_init_hook>     80a0:       e59fd1d8        ldr     sp, [pc, #472]  ; 8280 <__gnu_ldivmod_helper+0x14>     80a4:       ee110f10        mrc     15, 0, r0, cr1, cr0, {0}     80a8:       e3c00001        bic     r0, r0, #1     80ac:       ee010f10        mcr     15, 0, r0, cr1, cr0, {0}     80b0:       e59f31cc        ldr     r3, [pc, #460]  ; 8284 <__gnu_ldivmod_helper+0x18>     80b4:       e3a02000        mov     r2, #0     80b8:       e59f01c8        ldr     r0, [pc, #456]  ; 8288 <__gnu_ldivmod_helper+0x1c>  ...  disassembly of section .bt.arch.init:  00008000 <__bt_arch_init_start>:     8000:       00000401        andeq   r0, r0, r1, lsl #8     8004:       00010180        andeq   r0, r1, r0, lsl #3     8008:       07735940        ldrbeq  r5, [r3, -r0, asr #18]!     800c:       0000a020        andeq   sl, r0, r0, lsr #32     8010:       00009ffc        strdeq  r9, [r0], -ip     8014:       00000000        andeq   r0, r0, r0     8018:       00010550        andeq   r0, r1, r0, asr r5     801c:       00010580        andeq   r0, r1, r0, lsl #11         ... 
know why cursor gets reset?

in advance.

james

is bt_linker_init_section being defined somewhere?


raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support