2017-11-01 30 views
0

は、私はcreatindライブラリた後 aarch64-none-elf-gcc -shared -o libhello.so ../src/helloworld.o未定義の参照、ザイリンクスSDKでdlcloseの

を使用して私は1つの共有ライブラリを作成した共有librariesand( libhello.so を)働いています私はdynamiclly

void *handle; 
void (*foo)(void); 
handle = dlopen("/proj/ssw_xhd/boot/balakrish/workspace/hello_world/Debug/libhello.so", RTLD_GLOBAL); 
foo = dlsym(handle,"foo"); 
if (foo){ 
    library_function(); 
} 
dlclose(handle); 

としての私のCファイルにロードされた。しかし

<artificial>:(.text.startup+0x18c): undefined reference to `dlopen' 
<artificial>:(.text.startup+0x18c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dlopen' 
<artificial>:(.text.startup+0x1a0): undefined reference to `dlsym' 
<artificial>:(.text.startup+0x1a0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dlsym' 
<artificial>:(.text.startup+0x1a8): undefined reference to `library_function' 
<artificial>:(.text.startup+0x1a8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `library_function' 
<artificial>:(.text.startup+0x1b0): undefined reference to `dlclose' 
<artificial>:(.text.startup+0x1b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dlclose' 
collect2: error: ld returned 1 exit status 
make: *** [fsbl.elf] Error 1 
を次のように私はエラーを取得しています3210

C/C++ビルド設定 - > ARM v8 gccリンカー - >ライブラリ - >ライブラリ(dl) - >ライブラリパス(/ usr/lib /または/ usr/lib64 /) そして、あなたは、クロスアームためにLinuxの(インテル)からコンパイルする場合

Building target: fsbl.elf 
Invoking: ARM v8 gcc linker 
aarch64-none-elf-gcc -L"/proj/ssw_xhd/boot/balakrish/workspace/hello_world/Debug" -L/usr/lib64/ -L/usr/local/lib -Wl,-T -Wl,../src/lscript.ld -L../../fsbl_bsp/psu_cortexa53_0/lib -o "fsbl.elf" ./src/psu_init.o ./src/xfsbl_authentication.o ./src/xfsbl_board.o ./src/xfsbl_bs.o ./src/xfsbl_csu_dma.o ./src/xfsbl_dfu_util.o ./src/xfsbl_exit.o ./src/xfsbl_handoff.o ./src/xfsbl_hooks.o ./src/xfsbl_image_header.o ./src/xfsbl_initialization.o ./src/xfsbl_main.o ./src/xfsbl_misc.o ./src/xfsbl_misc_drivers.o ./src/xfsbl_nand.o ./src/xfsbl_partition_load.o ./src/xfsbl_plpartition_valid.o ./src/xfsbl_qspi.o ./src/xfsbl_rsa_sha.o ./src/xfsbl_sd.o ./src/xfsbl_translation_table.o ./src/xfsbl_usb.o -lhello -ldl -Wl,--start-group,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilffs,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilsecure,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilpm,-lxil,-lgcc,-lc,--end-group -n 
/wrk/released/2017.3/GA/2017.3_1005_1/installs/lin64/SDK/2017.3/gnu/aarch64/lin/aarch64-none/bin/../lib/gcc/aarch64-none-elf/6.2.1/../../../../aarch64-none-elf/bin/ld: cannot find -ldl 
collect2: error: ld returned 1 exit status 
make: *** [fsbl.elf] Error 1 

14:08:01 Build Finished (took 5s.747ms) 

答えて

0

としてエラーを取得し、その後、-Lは/ usr/lib64に/ -L/usr/local/libディレクトリ ポイントあなたのx86_64版のライブラリにではなく、あなたの腕にライブラリ

+0

こんにちは、クロスコンパイルで-ldlにアクセスするには、-L /wrk/released/2017.3/GA/2017.3_1005_1/installs/lin64/SDK/2017.3/gnu/aarch64/lin/aarch64-noneを使用することができます/bin/../lib/gcc/aarch64-none-elf/6.2.1/../../../../aarch64-none-elf/bin/ld –

+0

libdl.so *ファイルを含むアームSDKのPATHを探します。そして-PATHと-Lを-ldl – awahl