dsklzerpx64815631 2016-07-15 07:24 采纳率: 100%
浏览 185

GOLANG静态库链接

OS->Ubuntu 16.04 LTS | Go Vesrion-> 1.6.2 64 bit

I am using this github.com/xeodou/go-sqlcipher PKG

This Pkg need ->libcrypto library

This is the Link of program what i am compiling from _example folder from above pkg https://play.golang.org/p/drJGhsWiEi

when i am using-> go build encryption.go (encryption binary genrated)

command-> file ./encryption

encryption: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=91d49d6db997f83dfc722b820e5cab4cc16854cf, not stripped

command-> ldd ./encrption

    linux-vdso.so.1 =>  (0x00007ffca8fba000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fa93c071000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa93be6d000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa93bc4f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa93b886000)
    /lib64/ld-linux-x86-64.so.2 (0x000055f1aa574000)

command-> ./encryption

Output i am getting - {"name":"xeodou", "password": "123456"}

when i am using ->go build --ldflags '-extldflags "-static"' encryption.go

command-> file ./encryption

encryption: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=71fa3d0c30cc5c52dd4f8bea432f8e0468225f9a, not stripped

command-> ldd ./encryption

   not a dynamic executable

command-> ./encryption

Output i am getting - Segmentation fault (core dumped)

The thing i am not getting is when same binary run in other device some it worked some not.

Please guide me

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP