$LIB variable does not expand to anything in Ubuntu Server 18.10












0














I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that is referenced in the ld.so.preload file on any binary execution. The problem was that I was getting a ERROR: ld.so: object '/usr/local/lib/libprocesshider.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. when executing 32-bit programs.



To fix the issue according to the answer in that question, I had to make two directories (lib/i386-linux-gnu and x86_64-linux-gnu, for example, in /var/opt) and specify /var/opt/$LIB/mysharedobject.so in /etc/ld.so.preload so the right library will be preloaded depending in program architecture.



So in that case, in Debian based systems, /var/opt/$LIB/mysharedobject.so would expand to:





  • /var/opt/lib/i386-linux-gnu/mysharedobject.so for 32-bit programs;


  • /var/opt/x86_64-linux-gnu/mysharedobject.so for 64-bit programs.


However, after applying this, any binary I run (such as ls) will output the following 'error':
ERROR: ld.so: object '/var/opt/$LIB/chainsaw.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.



As you can see, $LIB did not expand to anything. I have also set $LD_LIBRARY_PATH to /var/opt and ran ldconfig to update the system with this libs, but with no success. What is the problem here?










share|improve this question



























    0














    I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that is referenced in the ld.so.preload file on any binary execution. The problem was that I was getting a ERROR: ld.so: object '/usr/local/lib/libprocesshider.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. when executing 32-bit programs.



    To fix the issue according to the answer in that question, I had to make two directories (lib/i386-linux-gnu and x86_64-linux-gnu, for example, in /var/opt) and specify /var/opt/$LIB/mysharedobject.so in /etc/ld.so.preload so the right library will be preloaded depending in program architecture.



    So in that case, in Debian based systems, /var/opt/$LIB/mysharedobject.so would expand to:





    • /var/opt/lib/i386-linux-gnu/mysharedobject.so for 32-bit programs;


    • /var/opt/x86_64-linux-gnu/mysharedobject.so for 64-bit programs.


    However, after applying this, any binary I run (such as ls) will output the following 'error':
    ERROR: ld.so: object '/var/opt/$LIB/chainsaw.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.



    As you can see, $LIB did not expand to anything. I have also set $LD_LIBRARY_PATH to /var/opt and ran ldconfig to update the system with this libs, but with no success. What is the problem here?










    share|improve this question

























      0












      0








      0







      I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that is referenced in the ld.so.preload file on any binary execution. The problem was that I was getting a ERROR: ld.so: object '/usr/local/lib/libprocesshider.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. when executing 32-bit programs.



      To fix the issue according to the answer in that question, I had to make two directories (lib/i386-linux-gnu and x86_64-linux-gnu, for example, in /var/opt) and specify /var/opt/$LIB/mysharedobject.so in /etc/ld.so.preload so the right library will be preloaded depending in program architecture.



      So in that case, in Debian based systems, /var/opt/$LIB/mysharedobject.so would expand to:





      • /var/opt/lib/i386-linux-gnu/mysharedobject.so for 32-bit programs;


      • /var/opt/x86_64-linux-gnu/mysharedobject.so for 64-bit programs.


      However, after applying this, any binary I run (such as ls) will output the following 'error':
      ERROR: ld.so: object '/var/opt/$LIB/chainsaw.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.



      As you can see, $LIB did not expand to anything. I have also set $LD_LIBRARY_PATH to /var/opt and ran ldconfig to update the system with this libs, but with no success. What is the problem here?










      share|improve this question













      I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that is referenced in the ld.so.preload file on any binary execution. The problem was that I was getting a ERROR: ld.so: object '/usr/local/lib/libprocesshider.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. when executing 32-bit programs.



      To fix the issue according to the answer in that question, I had to make two directories (lib/i386-linux-gnu and x86_64-linux-gnu, for example, in /var/opt) and specify /var/opt/$LIB/mysharedobject.so in /etc/ld.so.preload so the right library will be preloaded depending in program architecture.



      So in that case, in Debian based systems, /var/opt/$LIB/mysharedobject.so would expand to:





      • /var/opt/lib/i386-linux-gnu/mysharedobject.so for 32-bit programs;


      • /var/opt/x86_64-linux-gnu/mysharedobject.so for 64-bit programs.


      However, after applying this, any binary I run (such as ls) will output the following 'error':
      ERROR: ld.so: object '/var/opt/$LIB/chainsaw.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.



      As you can see, $LIB did not expand to anything. I have also set $LD_LIBRARY_PATH to /var/opt and ran ldconfig to update the system with this libs, but with no success. What is the problem here?







      debian dynamic-linking elf dynamic-loading






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      bashbinbashbin

      4615




      4615






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493364%2flib-variable-does-not-expand-to-anything-in-ubuntu-server-18-10%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493364%2flib-variable-does-not-expand-to-anything-in-ubuntu-server-18-10%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt