<legend id='IlcBe'><style id='IlcBe'><dir id='IlcBe'><q id='IlcBe'></q></dir></style></legend>

    <i id='IlcBe'><tr id='IlcBe'><dt id='IlcBe'><q id='IlcBe'><span id='IlcBe'><b id='IlcBe'><form id='IlcBe'><ins id='IlcBe'></ins><ul id='IlcBe'></ul><sub id='IlcBe'></sub></form><legend id='IlcBe'></legend><bdo id='IlcBe'><pre id='IlcBe'><center id='IlcBe'></center></pre></bdo></b><th id='IlcBe'></th></span></q></dt></tr></i><div id='IlcBe'><tfoot id='IlcBe'></tfoot><dl id='IlcBe'><fieldset id='IlcBe'></fieldset></dl></div>

    1. <tfoot id='IlcBe'></tfoot>

      <small id='IlcBe'></small><noframes id='IlcBe'>

        <bdo id='IlcBe'></bdo><ul id='IlcBe'></ul>

      意外的重定位类型 0x03

      unexpected reloc type 0x03(意外的重定位类型 0x03)

          <tbody id='IKX8U'></tbody>
        <tfoot id='IKX8U'></tfoot>

          <small id='IKX8U'></small><noframes id='IKX8U'>

            <bdo id='IKX8U'></bdo><ul id='IKX8U'></ul>
                <legend id='IKX8U'><style id='IKX8U'><dir id='IKX8U'><q id='IKX8U'></q></dir></style></legend>

                <i id='IKX8U'><tr id='IKX8U'><dt id='IKX8U'><q id='IKX8U'><span id='IKX8U'><b id='IKX8U'><form id='IKX8U'><ins id='IKX8U'></ins><ul id='IKX8U'></ul><sub id='IKX8U'></sub></form><legend id='IKX8U'></legend><bdo id='IKX8U'><pre id='IKX8U'><center id='IKX8U'></center></pre></bdo></b><th id='IKX8U'></th></span></q></dt></tr></i><div id='IKX8U'><tfoot id='IKX8U'></tfoot><dl id='IKX8U'><fieldset id='IKX8U'></fieldset></dl></div>
              1. 本文介绍了意外的重定位类型 0x03的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试执行用我自己的库编译的程序,但是当我执行该程序时出现以下错误:

                I'm trying to execute a program compiled with my own library, but when i execute the program I get the following error:

                ./a.out 
                ./a.out: error while loading shared libraries: ../../lib-arm/libCustomLibrary.so: unexpected reloc type 0x03
                

                这只是在 Release 执行中发生,在 Debug 执行中一切正常.

                That just happens with the Release execution, with the Debug execution all works fine.

                您认为这可能是哪里的问题?

                Where do you think that may be the problem?

                CustomLibrary 库与以下参数链接:

                The CustomLibrary Library is linked with the following arguments:

                -lSubLibrary -fPIC -Wl,-Bstatic -lboost_system -lboost_filesystem -lboost_thread -lpthread -Wl,-Bdynamic -lrt
                

                我附上了我的库的 lld unix 库命令输出.

                I attatch the lld unix library command output for my library.

                ldd ../../lib-arm/libCustomLibrary.so 
                /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x76e5d000)
                libSubLibrary.so => ../../lib-arm/libSubLibrary.so (0x76e2d000)
                librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76e10000)
                libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76d3e000)
                libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76ccd000)
                libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76ca5000)
                libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76b75000)
                libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76b6a000)
                libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76b4b000)
                /lib/ld-linux-armhf.so.3 (0x76f05000)
                

                推荐答案

                来自 https://lists.linaro.org/pipermail/linaro-toolchain/2012-November/002939.html :

                重定位类型 3 是 R_ARM_REL32,它是静态重定位而不是允许在共享对象中.你是如何创建共享库的?制作确保使用 -fPIC 编译所有进入其中的代码.

                Relocation type 3 is R_ARM_REL32 which is a static relocation not allowed in shared objects. How did you create the shared lib? Make sure you compile all the code going into it with -fPIC.

                换句话说,您在链接程序时使用了 -fPIC,但在构建共享库时可能没有使用.

                In other words, you are using -fPIC when linking your program, but perhaps not when building your shared library.

                这篇关于意外的重定位类型 0x03的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                What is a dangling reference?(什么是悬空引用?)
                C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)

                <small id='l5uvH'></small><noframes id='l5uvH'>

                  <tbody id='l5uvH'></tbody>

                <tfoot id='l5uvH'></tfoot>
                    • <i id='l5uvH'><tr id='l5uvH'><dt id='l5uvH'><q id='l5uvH'><span id='l5uvH'><b id='l5uvH'><form id='l5uvH'><ins id='l5uvH'></ins><ul id='l5uvH'></ul><sub id='l5uvH'></sub></form><legend id='l5uvH'></legend><bdo id='l5uvH'><pre id='l5uvH'><center id='l5uvH'></center></pre></bdo></b><th id='l5uvH'></th></span></q></dt></tr></i><div id='l5uvH'><tfoot id='l5uvH'></tfoot><dl id='l5uvH'><fieldset id='l5uvH'></fieldset></dl></div>

                          <bdo id='l5uvH'></bdo><ul id='l5uvH'></ul>
                          <legend id='l5uvH'><style id='l5uvH'><dir id='l5uvH'><q id='l5uvH'></q></dir></style></legend>