2011年6月29日 星期三

吉籟獵人學校

吉籟獵人學校
http://www.cidal.com.tw/
專辦花蓮旅遊,花蓮民宿,花東旅遊,台東民宿,花東旅遊週休二日,花東旅遊套裝行程,週休二日花東旅遊,花東旅遊親子露營,吉賴獵人學校

花蓮縣吉安鄉中華路二段106號
03-851-3990

吉籟獵人學校 Cidal Hunter School
http://blog.sina.com.tw/cidal420/

Source object XXX has EABI version 4, but target u-boot has EABI version 0

u-boot-2008.10, uclibc toolchain or Soucery G++ lite arm2009q1-203.
After enabling CFG_64BIT_VSPRINTF, building fails with following message

UNDEF_SYM=`arm-linux-objdump -x board/cavium/cns3000/libcns3000.a lib_generic/libgeneric.a lib_generic/lzma/liblzma.a cpu/arm11mpcore/libarm11mpcore.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a | \
sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /u-boot-2008.10 && arm-linux-ld -Bstatic -T /u-boot-2008.10/board/cavium/cns3000/u-boot.lds -Ttext 0x00000000 $UNDEF_SYM cpu/arm11mpcore/start.o \
--start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a cpu/arm11mpcore/libarm11mpcore.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/cavium/cns3000/libcns3000.a --end-group -L /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3 -lgcc \
-Map u-boot.map -o u-boot
/tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
/home/1/buildroot-2010.05/buildroot-2010.05/output/toolchain/gcc-4.3.3/libgcc/../gcc/config/arm/lib1funcs.asm:810: multiple definition of `__udivsi3'
lib_arm/libarm.a(_udivsi3.o):/u-boot-2008.10/lib_arm/_udivsi3.S:17: first defined here
arm-linux-ld: error: Source object /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivdi3.o) has EABI version 4, but target u-boot has EABI version 0
arm-linux-ld: failed to merge target specific data of file /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivdi3.o)
arm-linux-ld: error: Source object /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_umoddi3.o) has EABI version 4, but target u-boot has EABI version 0
arm-linux-ld: failed to merge target specific data of file /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_umoddi3.o)
arm-linux-ld: error: Source object /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivsi3.o) has EABI version 4, but target u-boot has EABI version 0
arm-linux-ld: failed to merge target specific data of file /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivsi3.o)
arm-linux-ld: error: Source object /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_clz.o) has EABI version 4, but target u-boot has EABI version 0
arm-linux-ld: failed to merge target specific data of file /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_clz.o)
/tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_udivdi3.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
/tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_umoddi3.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'


After removing "-L /tools/uclibc-toolchain/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/bin/../lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3 -lgc":
UNDEF_SYM=`arm-linux-objdump -x board/cavium/cns3000/libcns3000.a lib_generic/libgeneric.a lib_generic/lzma/liblzma.a cpu/arm11mpcore/libarm11mpcore.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a | \
sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /u-boot-2008.10 && arm-linux-ld -Bstatic -T /u-boot-2008.10/board/cavium/cns3000/u-boot.lds -Ttext 0x00000000 $UNDEF_SYM cpu/arm11mpcore/start.o \
--start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a cpu/arm11mpcore/libarm11mpcore.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/cavium/cns3000/libcns3000.a --end-group \
-Map u-boot.map -o u-boot
lib_generic/libgeneric.a(vsprintf.o): In function `number':
/u-boot-2008.10/lib_generic/vsprintf.c:165: undefined reference to `__udivdi3'
/u-boot-2008.10/lib_generic/vsprintf.c:165: undefined reference to `__umoddi3'




[U-Boot] [PATCH] ARM: Use do_div() instead of division for "long long".
http://lists.denx.de/pipermail/u-boot/2008-September/040254.html

[U-Boot] [PATCH] ARM - Integrator[AP/CP] - - Correct Improper ulong division
http://lists.denx.de/pipermail/u-boot/2008-August/039531.html

Re: [arm-gnu] EABI version 5, but target u-boot has EABI version 0
http://www.codesourcery.com/archives/arm-gnu/msg02478.html

Re: [arm-gnu] In Function __aeabi_ldiv0 : undefined reference to 'raise'
http://www.codesourcery.com/archives/arm-gnu/msg02332.html
U-Boot is not a GNU/Linux application. However, you're using the GNU/Linux toolchain to compile it -- so the libraries assume the presence of a GNU/Linux C library. In this case, the division routine wants to call "raise" to signal a division-by-zero exception.

People often try to abuse the GNU/Linux toolchain to build U-Boot because they want to use the same toolchain that they use to build the Linux kernel and GNU/Linux applications. But, U-Boot is really a bare-metal application, and, as such, should be built with a bare-metal toolchain, like our "ARM EABI" toolchains. There are often these kinds of problems with U-Boot when moving between different architectures or toolchain versions because the U-Boot source code has tricks to try to make the GNU/Linux toolchain work, and those tricks only work with
particular toolchains.


Re: [arm-gnu] EABI version 5, but target u-boot has EABI version 0
http://www.codesourcery.com/archives/arm-gnu/msg02479.html
U-boot explicitly compiles its binaries for ARM with -mabi=apcs-gnu, not EABI, so linking to any EABI compiled libgcc will cause the same error message.

In mainline U-boot currently all libgcc-provided-routines for ARM are also implemented in the lib_arm directory. (yes, it is dirty, but it is done this way for ARM). So, as long as there is an implementation in the lib_Arm directory, nothing will be used from libgcc, and this error will not be seen, even if you use a linux destined compiler.

I noticed that this question was about an very out-dated version of U-boot, namely 1.1.4, so that might be cause some troubles as well.

So, use a proper compiler toolchain (not EABI, but surely a bare metal edition). Several options are possible, you can also use the ARM-ELDK from denx.de

Fixed by:
diff --git a/bootloaders/u-boot-2008.10/Makefile b/bootloaders/u-boot-2008.10/Makefile
index 6004828..e4cd1a6 100644
--- a/bootloaders/u-boot-2008.10/Makefile
+++ b/bootloaders/u-boot-2008.10/Makefile
@@ -267,7 +267,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
LIBBOARD := $(addprefix $(obj),$(LIBBOARD))

# Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
+#PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc

# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
diff --git a/bootloaders/u-boot-2008.10/lib_generic/vsprintf.c b/bootloaders/u-boot-2008.10/lib_generic/vsprintf.c
index 7c9cfe1..efc6710 100644
--- a/bootloaders/u-boot-2008.10/lib_generic/vsprintf.c
+++ b/bootloaders/u-boot-2008.10/lib_generic/vsprintf.c
@@ -14,6 +14,10 @@
#include <linux/string.h>
#include <linux/ctype.h>

+#ifdef CFG_64BIT_VSPRINTF
+#include <div64.h>
+#endif
+
#include <common.h>
#if !defined (CONFIG_PANIC_HANG)
#include <command.h>
@@ -106,12 +110,14 @@ static int skip_atoi(const char **s)
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */

#ifdef CFG_64BIT_VSPRINTF
+#if 0
#define do_div(n,base) ({ \
unsigned int __res; \
__res = ((unsigned long long) n) % base; \
n = ((unsigned long long) n) / base; \
__res; \
})
+#endif
#else
#define do_div(n,base) ({ \
int __res; \

2011年6月27日 星期一

git log --graph

用 git 指令產生 Change log 格式
http://blog.wu-boy.com/2011/06/%E7%94%A8-git-%E6%8C%87%E4%BB%A4%E7%94%A2%E7%94%9F-change-log-%E6%A0%BC%E5%BC%8F/


git log --no-merges --pretty=format:' - %s'
git log --graph --pretty=format:'%s - %Cred%h%Creset %Cgreen(%cr)%Creset %an' --abbrev-commit --date=relative

2011年6月23日 星期四

CONFIG_DEFAULT_MMAP_MIN_ADDR

2.6.30-r4: DEFAULT_MMAP_MIN_ADDR [Solved]
http://forums.gentoo.org/viewtopic-t-783380.html?sid=51239f34dd7c9e99dc03156f4860b860

Re: mmap_min_addr/SECURITY_DEFAULT_MMAP_MIN_ADDR suggested values
http://lkml.indiana.edu/hypermail/linux/kernel/0806.2/2733.html

Clever attack exploits fully-patched Linux kernel
http://www.theregister.co.uk/2009/07/17/linux_kernel_exploit/

Bug in latest Linux gives untrusted users root access
http://www.theregister.co.uk/2009/11/03/linux_kernel_vulnerability/

# ps x

457 root -sh

# cat /proc/457/maps
00008000-000a5000 r-xp 00000000 01:00 2045 /bin/busybox
000ac000-000ad000 rw-p 0009c000 01:00 2045 /bin/busybox
000ad000-000d0000 rw-p 00000000 00:00 0 [heap]
35556000-35558000 rw-p 00000000 00:00 0
35558000-35578000 r-xp 00000000 01:00 17296 /lib/ld-2.8.so
(................)
9e9b3000-9e9d4000 rw-p 00000000 00:00 0 [stack]


x86's default text address start from 0x08048000
ARM's default text address start from 0x8000

binutils-2.20.1/gold/arm.cc
"/usr/lib/libc.so.1", // dynamic_linker
0x8000, // default_text_segment_address
0x1000, // abi_pagesize (overridable by -z max-page-size)
0x1000, // common_pagesize (overridable by -z common-page-size)


binutils-2.20.1/gold/i386.cc
"/usr/lib/libc.so.1", // dynamic_linker
0x08048000, // default_text_segment_address
0x1000, // abi_pagesize (overridable by -z max-page-size)
0x1000, // common_pagesize (overridable by -z common-page-size)


To change the text segment address on compile time, give "-Ttext-segment=0x20000" to ld, or "-Wl,-Ttext-segment=0x20000" to gcc.


It seems that ARM use the smallest text segment address.

CONFIG_DEFAULT_MMAP_MIN_ADDR, set to 4096, will prevent non-root users from accessing the pages within the address. And while building user space program, ld will put the text segment starting from 0x8000(32k) on ARM by default.

When page size is 64k, 0x8000(32k) and CONFIG_DEFAULT_MMAP_MIN_ADDR are both at the 0th page, which is causing non-root user cannot run the binary built by the toolchain, e.g. busybox.

It can be workaround by adding "-Wl,-Ttext-segment=0x10000" while building user space applications. But there are too many of them.

Therefore, the default text segment address used by ld should be updated to minimum value of page size.

#grep default_text_segment_address binutils-2.20.1/gold/ -rHin
# grep default_text_segment_address binutils-2.20.1/gold/ -rHin
binutils-2.20.1/gold/powerpc.cc:344: 0x10000000, // default_text_segment_address
binutils-2.20.1/gold/powerpc.cc:365: 0x10000000, // default_text_segment_address
binutils-2.20.1/gold/powerpc.cc:386: 0x10000000, // default_text_segment_address
binutils-2.20.1/gold/powerpc.cc:407: 0x10000000, // default_text_segment_address
binutils-2.20.1/gold/i386.cc:443: 0x08048000, // default_text_segment_address
binutils-2.20.1/gold/sparc.cc:363: 0x00010000, // default_text_segment_address
binutils-2.20.1/gold/sparc.cc:384: 0x100000, // default_text_segment_address
binutils-2.20.1/gold/arm.cc:484: 0x8000, // default_text_segment_address
binutils-2.20.1/gold/layout.cc:2184: addr = target->default_text_segment_address();
binutils-2.20.1/gold/x86_64.cc:441: 0x400000, // default_text_segment_address
binutils-2.20.1/gold/testsuite/testfile.cc:100: 0x08000000, // default_text_segment_address
binutils-2.20.1/gold/target.h:105: default_text_segment_address() const
binutils-2.20.1/gold/target.h:106: { return this->pti_->default_text_segment_address; }
binutils-2.20.1/gold/target.h:300: uint64_t default_text_segment_address;

undefined reference to `strverscmp'

[Bug 1939] New: strverscmp failure
http://lists.busybox.net/pipermail/uclibc-cvs/2010-June/028104.html
[git commit master] strverscmp: I forgot to export it
http://lists.busybox.net/pipermail/uclibc-cvs/2010-June/028105.html

commit 139b8f0c673fed465d27f99c98568e5d5e1b9b72
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date: Fri Jun 4 13:36:30 2010 +0200

strverscmp: I forgot to export it

Result was:

strverscmp.o:
000000ec T __GI_strverscmp

i.e. no plain "strverscmp"!

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

2011年6月21日 星期二

dm-crypt: a device-mapper crypto target

dm-crypt: a device-mapper crypto target
http://www.saout.de/misc/dm-crypt/

In Linux kernel Source: /Documentation/device-mapper/dm-crypt.txt

dm-crypt: Linux kernel device-mapper crypto target
http://code.google.com/p/cryptsetup/wiki/DMCrypt

[wiki] dm-crypt
http://en.wikipedia.org/wiki/Dm-crypt

[Gentoo] 使用 dm-crypt 做磁碟加密
http://www.csie.nctu.edu.tw/~lylai/disk-cryptography.html


Required kernel config:
CONFIG_BLK_DEV_DM
CONFIG_DM_CRYPT

(add required crypto support)
CONFIG_CRYPTO_AES


cryptsetup -y -c aes -s 256 create crypt_disk /dev/sda1
mkfs.ext3 /dev/mapper/crypt_disk
mount /dev/mapper/crypt_disk /mnt

umount /mnt
cryptsetup remove crypt_disk

2011年6月18日 星期六

自己做豆腐

學做豆腐
http://www.hopemarket.com.tw/?p=4499

自己做豆腐
http://www.wretch.cc/blog/trufflerose/10622894

│奇事│自做豆腐DIY組合包
http://blog.yam.com/michelle0918/article/10963045

自己做豆腐
http://www.godsdirectcontact.org.tw/ch1/food/specialty/19-a%20homemade%20tofu%20.php

自己做豆腐
http://ginswork.pixnet.net/blog/post/32669701

UBIFS - UBI File-System

UBI文件系统简介
http://www.dzsc.com/data/html/2009-7-22/77782.html

ubi以及ubifs
http://www.cublog.cn/u3/105635/showart_2090477.html

UBI - Unsorted Block Images
http://www.linux-mtd.infradead.org/doc/ubi.html

UBIFS - UBI File-System
http://www.linux-mtd.infradead.org/doc/ubifs.html

Raw flash vs. FTL devices
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl

What are the differences between flash devices and block drives?
http://www.linux-mtd.infradead.org/faq/general.html#L_mtd_vs_hdd



block2mtd and ubi are initialized too early when compiled in on 2.6.31-rc2
http://lkml.org/lkml/2009/7/15/143
http://patchwork.ozlabs.org/patch/29807/
http://patchwork.ozlabs.org/patch/29864/


CONFIG_MTD_UBI
CONFIG_UBIFS_FS

CONFIG_MTD_BLOCK2MTD (needed only if you need use UBI on block device)


modprobe block2mtd block2mtd=/dev/mmcblk0p2,128KiB
ubiformat /dev/mtd0
modprobe ubi mtd=0
ubimkvol /dev/ubi0 -N rootfs -s 10MiB
mount -t ubifs ubi0:rootfs /mnt


//rootwait doen't work, only roodelay do
set bootargs block2mtd.block2mtd=/dev/mmcblk0p2,128KiB ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs rw rootdelay=5


mkfs.ubifs

2011年6月17日 星期五

u-boot fw_printenv and fw_setenv

fw_printenv-control u-boot enviroment variables under linux
http://daydreamer.idv.tw/rewrite.php/read-60.html

U-boot environment variables in linux
http://elinux.org/U-boot_environment_variables_in_linux

2011年6月16日 星期四

gcc's -Wl option (ld's -rpath option)

GCC Frequently Asked Questions
http://gcc.gnu.org/faq.html
GCC Frequently Asked Questions: Dynamic linker is unable to find GCC libraries
http://gcc.gnu.org/faq.html#rpath

请教gcc的-rpath选项的意思是什么?
http://www.lslnet.com/linux/dosc1/46/linux-318887.htm

可以去掉啊。用-L就行了,这个其实是ld的选项,我做练习时的一个小例子这么编的:
gcc -Wl,-rpath,/home/arc/test,-rpath,/lib/,-rpath,/usr/lib/,-rpath,/usr/local/lib test.c

Might not be true on dynamic linked library.

gcc的-L选项和-Wl,-rpath,的区别是什么?
http://bbs.chinaunix.net/archiver/?tid-1786166.html

How to build an RPATH into gcc?
http://gcc.gnu.org/ml/gcc/2004-05/msg00275.html
http://gcc.gnu.org/ml/gcc/2004-05/msg00282.html
RPATH is evil (BTW if you really want it, set LDFLAGS='-Wl,-rpath -Wl,/usr/local/lib').

Much better:

# echo /usr/local/lib >> /etc/ld.so.conf
# ldconfig
#

And /lib/ld-linux.so.2 will search libraries there.


Program Library HOWTO
http://www.dwheeler.com/program-library/Program-Library-HOWTO/index.html

Program Library HOWTO
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Re: rpath problems
http://mail.gnome.org/archives/gtk-list/2002-July/msg00043.html
i believe that in general, the use of -rpath as a linker option is deprecated by most people. it will produce a binary that may do
undesirable things on some systems. its preferred to make the "executable" a shell script that sets LD_LIBRARY_PATH and then execs the "real" (binary) executable.

2011年6月8日 星期三

2011年6月1日 星期三

.mdi 檔案無法在 2007 Office 程式內含的 Microsoft Office Document Imaging 程式中開啟

.mdi 檔案無法在 2007 Office 程式內含的 Microsoft Office Document Imaging 程式中開啟
http://support.microsoft.com/kb/926198/zh-tw

Partition Rescue

fdisk -l -u

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a826d

Device Boot Start End Blocks Id System
/dev/sda1 63 2120579 1060258+ 83 Linux

cat /proc/partitions
major minor  #blocks  name
8 0 976762584 sda
8 1 23635968 sda1
8 2 1 sda2
8 5 953123840 sda5

hdparm -g /dev/sda1
/dev/sda1:
geometry = 56065/255/63, sectors = 47271936, start = 1906251776

hdparm -g /dev/sda2
/dev/sda2:
geometry = 56065/255/63, sectors = 2, start = 2046

hdparm -g /dev/sda3
/dev/sda3: No such file or directory

hdparm -g /dev/sda4
/dev/sda4: No such file or directory

hdparm -g /dev/sda5
/dev/sda5:
geometry = 118658/255/63, sectors = 1906247680, start = 2048


gpart /dev/sda
Begin scan...

Possible partition(Linux ext2), size(84mb), offset(426321mb)
End scan.

Checking partitions...
Partition(Linux ext2 filesystem): primary
Ok.

Guessed primary partition table:
Primary partition(1)
type: 131(0x83)(Linux ext2 filesystem)
size: 84mb #s(172032) s(873105408-873277439)
chs: (1023/254/63)-(1023/254/63)d (54348/76/1)-(54359/1/42)r

Primary partition(2)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(3)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r




Partition-Rescue HOWTO
http://www.faqs.org/docs/Linux-mini/Partition-Rescue.html