Want more features on Pastebin? Sign Up, it's FREE!
Guest

linker script issue

By: a guest on Oct 8th, 2013  |  syntax: None  |  size: 10.53 KB  |  views: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. The link error:
  2.  
  3. MacBook-Pro-de-Yann-Sionneau:NetBSD fallen$ ./build.sh -m milkymist -U -u kernel=GENERIC
  4. ===> build.sh command:    ./build.sh -m milkymist -U -u kernel=GENERIC
  5. ===> build.sh started:    Tue Oct  8 22:46:21 CEST 2013
  6. ===> NetBSD version:      6.99.16
  7. ===> MACHINE:             milkymist
  8. ===> MACHINE_ARCH:        lm32
  9. ===> Build platform:      Darwin 10.8.0 i386
  10. ===> HOST_SH:             /bin/sh
  11. ===> MAKECONF file:       /etc/mk.conf (File not found)
  12. ===> TOOLDIR path:        /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386
  13. ===> DESTDIR path:        /Users/fallen/dev/NetBSD/obj/destdir.milkymist
  14. ===> RELEASEDIR path:     /Users/fallen/dev/NetBSD/obj/releasedir
  15. ===> Updated makewrapper: /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/nbmake-milkymist
  16. ===> Building kernel without building new tools
  17. ===> Building kernel:     GENERIC
  18. ===> Build directory:     /Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC
  19. Build directory is /Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC
  20. Don't forget to run "make depend"
  21. depending the kern library objects
  22. depending the compat library objects
  23. making sure the compat library is up to date...
  24. `libcompat.a' is up to date.
  25. making sure the kern library is up to date...
  26. `libkern.o' is up to date.
  27. #      link  GENERIC/netbsd
  28. /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-ld -Map netbsd.map --cref -n -T /Users/fallen/dev/NetBSD/sys/arch/milkymist/conf/kern.ldscript -Ttext 0xc0000000 -e start -S -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
  29. /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-ld: section link_set_bufq_strats loaded at [00000000400fc4b0,00000000400fc4bb] overlaps section .data loaded at [00000000400fc4b0,000000004010288f]
  30. /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-ld: warning: cannot find entry symbol start; defaulting to 00000000c0000000
  31.  
  32. *** Failed target:  netbsd
  33. *** Failed command: echo '# ' " link GENERIC/netbsd"; echo /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-ld -Map netbsd.map --cref -n -T /Users/fallen/dev/NetBSD/sys/arch/milkymist/conf/kern.ldscript -Ttext 0xc0000000 -e start -S -o netbsd '${SYSTEM_OBJ}' '${EXTRA_OBJ}' vers.o; /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-ld -Map netbsd.map --cref -n -T /Users/fallen/dev/NetBSD/sys/arch/milkymist/conf/kern.ldscript -Ttext 0xc0000000 -e start -S -o netbsd locore.o devsw.o ioconf.o param.o autoconf.o bpf_stub.o bufq_disksort.o bufq_fcfs.o clock.o clock_subr.o cnmagic.o cons.o copy.o cpu.o dead_vnops.o debugsyms.o dk.o exec_subr.o fdesc_vfsops.o fdesc_vnops.o fifo_vnops.o genfs_io.o genfs_rename.o genfs_vfsops.o genfs_vnops.o if.o if_media.o init_main.o init_sysctl.o init_sysctl_base.o init_sysent.o interrupt.o intr.o kern_acct.o kern_auth.o kern_cfglock.o kern_clock.o kern_condvar.o kern_core.o kern_cpu.o kern_descrip.o kern_event.o kern_exec.o kern_exit.o kern_fork.o kern_hook.o kern_idle.o kern_kthread.o kern_lock.o kern_lwp.o kern_malloc.o kern_module.o kern_module_vfs.o kern_mutex.o kern_mutex_obj.o kern_ntptime.o kern_physio.o kern_pmf.o kern_proc.o kern_prot.o kern_ras.o kern_rate.o kern_resource.o kern_rndpool.o kern_rndq.o kern_runq.o kern_rwlock.o kern_rwlock_obj.o kern_sig.o kern_sleepq.o kern_softint.o kern_ssp.o kern_stub.o kern_subr.o kern_synch.o kern_syscall.o kern_sysctl.o kern_tc.o kern_time.o kern_timeout.o kern_todr.o kern_turnstile.o kern_uidinfo.o kern_uuid.o kern_xxx.o kernfs_subr.o kernfs_vfsops.o kernfs_vnops.o link_proto.o lock_stubs.o locore_subr.o machdep.o mainbus.o mfs_miniroot.o mm.o net_stats.o nist_ctr_drbg.o pmap.o process_machdep.o procfs_cmdline.o procfs_ctl.o procfs_fd.o procfs_fpregs.o procfs_linux.o procfs_machdep.o procfs_map.o procfs_mem.o procfs_note.o procfs_regs.o procfs_status.o procfs_subr.o procfs_vfsops.o procfs_vnops.o ptyfs_subr.o ptyfs_vfsops.o ptyfs_vnops.o quota1_subr.o radix.o raw_cb.o raw_usrreq.o rijndael-alg-fst.o rijndael-api-fst.o rijndael.o rndpseudo.o route.o rtbl.o rtsock.o sched_4bsd.o secmodel.o secmodel_bsd44.o secmodel_extensions.o secmodel_securelevel.o secmodel_suser.o sig_machdep.o spec_vnops.o subr_autoconf.o subr_blist.o subr_bufq.o subr_callback.o subr_copy.o subr_cprng.o subr_cpufreq.o subr_device.o subr_devsw.o subr_disk.o subr_disk_open.o subr_evcnt.o subr_exec_fd.o subr_extent.o subr_hash.o subr_humanize.o subr_iostat.o subr_kcpuset.o subr_kmem.o subr_kobj.o subr_kobj_vfs.o subr_lockdebug.o subr_log.o subr_lwp_specificdata.o subr_once.o subr_optstr.o subr_pcq.o subr_pcu.o subr_percpu.o subr_pool.o subr_prf.o subr_prof.o subr_pserialize.o subr_specificdata.o subr_time.o subr_vmem.o subr_workqueue.o subr_xcall.o sync_subr.o sync_vnops.o sys_aio.o sys_descrip.o sys_generic.o sys_lwp.o sys_machdep.o sys_module.o sys_mqueue.o sys_pipe.o sys_pmc.o sys_process.o sys_pset.o sys_sched.o sys_select.o sys_sig.o sys_socket.o syscall.o timer.o tmpfs_fifoops.o tmpfs_mem.o tmpfs_rename.o tmpfs_specops.o tmpfs_subr.o tmpfs_vfsops.o tmpfs_vnops.o tty.o tty_conf.o tty_ptm.o tty_pty.o tty_subr.o tty_tty.o uart.o uipc_accf.o uipc_domain.o uipc_mbuf.o uipc_mbuf2.o uipc_proto.o uipc_sem.o uipc_socket.o uipc_socket2.o uipc_syscalls.o uipc_usrreq.o uvm_amap.o uvm_anon.o uvm_aobj.o uvm_bio.o uvm_coredump.o uvm_device.o uvm_emap.o uvm_fault.o uvm_glue.o uvm_init.o uvm_io.o uvm_km.o uvm_loan.o uvm_map.o uvm_meter.o uvm_mmap.o uvm_mremap.o uvm_object.o uvm_page.o uvm_pager.o uvm_pdaemon.o uvm_pdpolicy_clock.o uvm_pglist.o uvm_readahead.o uvm_stat.o uvm_swap.o uvm_unix.o uvm_user.o uvm_vnode.o vfs_bio.o vfs_cache.o vfs_cwd.o vfs_dirhash.o vfs_getcwd.o vfs_hooks.o vfs_init.o vfs_lockf.o vfs_lookup.o vfs_mount.o vfs_quotactl.o vfs_subr.o vfs_syscalls.o vfs_trans.o vfs_vnode.o vfs_vnops.o vfs_xattr.o vm_machdep.o vnode_if.o /Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC/lib/compat/libcompat.a /Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC/lib/kern/libkern.o vers.o swapnetbsd.o
  34. *** Error code 1
  35.  
  36. Stop.
  37. nbmake: stopped in /Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC
  38.  
  39. ERROR: Failed to make all in "/Users/fallen/dev/NetBSD/sys/arch/milkymist/compile/obj/GENERIC"
  40. *** BUILD ABORTED ***
  41.  
  42. The linker script:
  43.  
  44. OUTPUT_FORMAT("elf32-lm32")
  45. ENTRY(_start)
  46.  
  47. __DYNAMIC = 0;
  48.  
  49. MEMORY {
  50.         sdram : ORIGIN = 0xc0000000, LENGTH = 0x8000000
  51. }
  52.  
  53. SECTIONS
  54. {
  55.         .text 0xc0000000 : AT ( 0x40000000 )
  56.         {
  57.                 _ftext = .;
  58.                 *(.text .stub .text.* .gnu.linkonce.t.*)
  59.                 _etext = .;
  60.         } > sdram
  61.  
  62.         .rodata ADDR(.text) + SIZEOF(.text) : AT ( LOADADDR(.text) + SIZEOF(.text) )
  63.         {
  64.                 . = ALIGN(4);
  65.                 _frodata = .;
  66.                 *(.rodata .rodata.* .gnu.linkonce.r.*)
  67.                 *(.rodata1)
  68.                 _erodata = .;
  69.         } > sdram
  70.  
  71.         /* We shouldn't have a .data section, however the GNU crapchain whines if we don't */
  72.         .data : AT ( LOADADDR(.rodata) + SIZEOF(.rodata) )
  73.         {
  74.                 . = ALIGN(4);
  75.                 _fdata = .;
  76.                 *(.data .data.* .gnu.linkonce.d.*)
  77.                 *(.data1)
  78.                 _gp = ALIGN(16);
  79.                 *(.sdata .sdata.* .gnu.linkonce.s.*)
  80.                _edata = .;
  81.         } > sdram
  82.  
  83.         .bss : AT ( LOADADDR(.data) + SIZEOF(.data) )
  84.         {
  85.                 . = ALIGN(4);
  86.                 _fbss = .;
  87.                 *(.dynsbss)
  88.                 *(.sbss .sbss.* .gnu.linkonce.sb.*)
  89.                 *(.scommon)
  90.                 *(.dynbss)
  91.                 *(.bss .bss.* .gnu.linkonce.b.*)
  92.                 *(COMMON)
  93.                 . = ALIGN(4);
  94.                 _ebss = .;
  95.                 _end = .;
  96.         } > sdram
  97. }
  98.  
  99. PROVIDE(_fstack = ORIGIN(sdram) + LENGTH(sdram) - 4);
  100. PROVIDE(_phy_do_real_tlb_miss_handling = _do_real_tlb_miss_handling - 0xc0000000 + 0x40000000);
  101.  
  102. Result of some commands:
  103.  
  104. MacBook-Pro-de-Yann-Sionneau:GENERIC fallen$ grep -Rsn "link_set_bufq_strats" *
  105. Binary file bufq_disksort.o matches
  106. Binary file bufq_fcfs.o matches
  107. netbsd.map:8218:link_set_bufq_strats
  108. netbsd.map:8221:                0x00000000c00fc4b0                PROVIDE (__start_link_set_bufq_strats, ABSOLUTE (.))
  109. netbsd.map:8222: link_set_bufq_strats
  110. netbsd.map:8224: link_set_bufq_strats
  111. netbsd.map:8226: link_set_bufq_strats
  112. netbsd.map:8228:                0x00000000c00fc4bc                PROVIDE (__stop_link_set_bufq_strats, .)
  113. netbsd.map:16144:__start_link_set_bufq_strats                      subr_bufq.o
  114. netbsd.map:16151:__stop_link_set_bufq_strats                       subr_bufq.o
  115. Binary file subr_bufq.o matches
  116.  
  117. MacBook-Pro-de-Yann-Sionneau:NetBSD fallen$ cd sys/arch/milkymist/compile/obj/GENERIC/
  118. MacBook-Pro-de-Yann-Sionneau:GENERIC fallen$ /Users/fallen/dev/NetBSD/obj/tooldir.Darwin-10.8.0-i386/bin/lm32--netbsd-nm *.o | grep "link_set_bufq"
  119. 00000000 r __link_set_bufq_strats_sym_bufq_strat_disksort
  120. 00000000 r __link_set_bufq_strats_sym_bufq_strat_fcfs
  121. 00000000 r __link_set_bufq_strats_sym_bufq_strat_dummy
  122.          U __start_link_set_bufq_strats
  123.          U __stop_link_set_bufq_strats
  124.  
  125.  
  126. MacBook-Pro-de-Yann-Sionneau:NetBSD fallen$ grep -Rsn "link_set_bufq_strats" *
  127. netbsd.S:266966:Disassembly of section link_set_bufq_strats:
  128. netbsd.S:266968:c00fc4a0 <__link_set_bufq_strats_sym_bufq_strat_disksort>:
  129. netbsd.S:266971:c00fc4a4 <__link_set_bufq_strats_sym_bufq_strat_fcfs>:
  130. netbsd.S:266974:c00fc4a8 <__link_set_bufq_strats_sym_bufq_strat_dummy>:
  131. Binary file sys/arch/milkymist/compile/obj/GENERIC/bufq_disksort.o matches
  132. Binary file sys/arch/milkymist/compile/obj/GENERIC/bufq_fcfs.o matches
  133. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8218:link_set_bufq_strats
  134. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8221:                0x00000000c00fc4b0                PROVIDE (__start_link_set_bufq_strats, ABSOLUTE (.))
  135. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8222: link_set_bufq_strats
  136. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8224: link_set_bufq_strats
  137. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8226: link_set_bufq_strats
  138. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:8228:                0x00000000c00fc4bc                PROVIDE (__stop_link_set_bufq_strats, .)
  139. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:16144:__start_link_set_bufq_strats                      subr_bufq.o
  140. sys/arch/milkymist/compile/obj/GENERIC/netbsd.map:16151:__stop_link_set_bufq_strats                       subr_bufq.o
  141. Binary file sys/arch/milkymist/compile/obj/GENERIC/subr_bufq.o matches
  142.  
  143. FYI netbsd.S is what I got by doing objdump -D on netbsd ELF binary.
clone this paste RAW Paste Data