小编Cha*_*hen的帖子

alpine ctypes loadlibrary() 上的 python 失败并出现 OSError: 重新定位 ./cc.so: 时出错: : 初始执行 TLS 解析为 ./cc.so 中的动态定义

我致力于在基于 alpine 的容器上使用 golang 在 python 脚本(ctypes loadlibrary)中构建共享库。

但失败如下,

/usr/src/app # **go build -o cc.so -buildmode=c-shared main.go**

/usr/src/app # **readelf -d cc.so**

Dynamic section at offset 0x10cd10 contains 22 entries: Tag Type
Name/Value 0x0000000000000001 (NEEDED) Shared library:
[libc.musl-x86_64.so.1] 0x0000000000000010 (SYMBOLIC) 0x0
0x000000000000000c (INIT) 0x42000 0x000000000000000d (FINI) 0x92ed9
0x0000000000000019 (INIT_ARRAY) 0xa2078 0x000000000000001b
(INIT_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x270
0x0000000000000005 (STRTAB) 0xa50 0x0000000000000006 (SYMTAB) 0x378
0x000000000000000a (STRSZ) 1026 (bytes) 0x000000000000000b (SYMENT) 24
(bytes) 0x0000000000000003 (PLTGOT) 0x10deb0 0x0000000000000002
(PLTRELSZ) 720 (bytes) 0x0000000000000014 (PLTREL) …
Run Code Online (Sandbox Code Playgroud)

python go docker alpine-linux

5
推荐指数
0
解决办法
1000
查看次数

标签 统计

alpine-linux ×1

docker ×1

go ×1

python ×1