problem about binutils-Collection of common programming errors


  • figroc
    gcc binutils
    I’m building binutils 2.24 on CentOS 6.5 x64. The tarball is from here: http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.gz. I’ve built GMP 5.1.3, MPFR 3.1.2, MPC 1.0.2 and Make 4.0 successfully by using GCC 4.4.7. Following commands are carried out building binutils 2.24:./configure –with-gmp=/usr/local –with-mpfr=/usr/local –with-mpc=/usr/local make make checkThe testsuite reported 5 unexpected failure as following:…Running /root/binutils-2.24/ld/testsuite/ld-elf/elf.exp …FAIL: static

  • Jeremy Salwen
    linux ld binutils relocation
    Running Debian/Linux x86_64 with GNU ld 2.21.Quite simply, if I link withld -o main main.o /usr/lib/crti.o /usr/lib/crt1.o /usr/lib/crtn.o -lc -lmIt works, but when I link withld -r -o main1.o main.o /usr/lib/crti.o /usr/lib/crt1.o /usr/lib/crtn.o -lc -lmIt complainsld: cannot find -lc ld: cannot find -lmI’m not actually trying to compile code this way, but rather I’m trying to figure out why someone else’s test to see if a library exists is not working. (Thus I don’t really understand what’s go

  • Dr3vvn45ty
    c++ linker g++ binutils
    I only need to use the iequals case-insensitive string comparison function from the BOOST library.I am using #include <boost/algorithm/string.hpp> to import it.Is there any way that I could only import the iequals function by itself?The reason I even care (I am really just curious.) is because the compiled DLL is about 230kB if I don’t #include it and about 1.1MB if I do. It doesn’t really make much difference in this particular case how large the file is, but it seems like there is a lot

  • lvella
    linux gcc shared-libraries cross-compiling binutils
    When developing for native platform, I can use ldd to list all the shared libraries (.so files) a binary executable I build will try to load upon start-up. But when cross-compiling, I don’t know how to get the same information. The ldd is not a normal binutils utility, like strip or ar, that can be built alongside gcc for cross compiling, but instead, it is a cryptic shell script that apparently can only run on native platform.So, using the cross-target binutils tools, is there any way to get a

  • Nathan Kidd
    linux g++ shared-libraries ld binutils
    Linux: It there a way to edit a compiled shared library ?specifically I am searching on how to add the DT_SYMBOLIC flag on an already compiled binary shared library?Here is why I am asking this:our application is composed of our own libraries (static libXXX.a) some 3rd party libs (binary-only shared libraries libYYY.so)Everything is fine with the application so far.Now I have replaced our own static* libXXX.a libraries with shared libraries versions (libXXX.so).Everything compiles and links fin

  • Krzysztof Kosinski
    g++ ld fftw binutils
    I have a linking problem which I cannot explain. The program contains references to FFTW functions in a file called fft.cpp. The linking command is as follows (I skipped the rest of object files):/usr/bin/g++ common/CleanerND.cpp.2.o … common/fft.cpp.2.o-o cleaner3d -Wl,-Bstatic -Wl,-Bdynamic -lmkl_intel_lp64 -lmkl_sequential -lmkl_core-lfftw3f -lgsl -lgslcblas -lm -lglib-2.0 -lz -lm -lpthread -fopenmpThe superfluous -Wl,-Bstatic -Wl,-Bdynamic options are generated by Waf, which I use as the b

  • R..
    c gcc linker binutils
    Is there a way with gcc and GNU binutils to mark some functions such that they will generate an error at link-time if used? My situation is that I have some library functions which I am not removing for the sake of compatibility with existing binaries, but I want to ensure that no newly-compiled binary tries to make use of the functions. I can’t just use compile-time gcc attributes because the offending code is ignoring my headers and detecting the presence of the functions with a configure scri

  • ildjarn
    c++ gcc linker c++11 binutils
    (Environment: gcc 4.6, c++11, glibc 2.13, binutils 2.21)Please consider the follow “linking” demo for background:foo.h:#pragma once #include <iostream>void foo();foo1.cpp:#include “foo.h”void foo() {std::cout << “foo1”; }foo2.cpp:#include “foo.h”void foo() {std::cout << “foo2”; }main.cpp:#include “foo.h”int main() {foo(); }Makefile:compile: main.o foo1.o foo2.ocase1: compileg++ -o case1.x main.ocase2: compileg++ -o case2.x main.o foo1.cppcase3: compileg++ -o case3.x main.o foo1

  • KONSTANTIN MALOLIN
    gcc osx-snow-leopard binutils ar
    Below is the description of the issue. I marked it all as a code to avoid the implicit formatting that StackOverflow does. That is pretty annoying to have to deal with the Wiki-like markup language when I know exactly myself how I want to format my question.I am dealing with a weird toolchain issue on Macos. Here is what is going on :$ cat gmpz.cchar foo ();int main (){return foo();}$ cat libmy.cchar foo(){return 0;}I run these commands :$ gcc -c libmy.c $ gcc gmpz.c libmy.o $ file ./a.out ./a

  • Andy Finkenstadt
    gcc linker ld binutils
    The -l option tells the linker to search the libraries in the standard dirs. And with -L, we can specify our own library directories for searching.Question: Does the sequence of order matters for the -L option too, like it does for the -l w.r.t the linker?This link: http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html doesn’t say much about the sequence of -L.EDIT Also, Directories specified on the commandline are searched before the defaultdirectoriesis from the man page (as pointed by Dmitry),

  • osgx
    linux shared-libraries binutils nm
    I want to find some external symbols, used by one shared library (.so) in another. I easily can runnm -D ./lib_the_one.soand get list of used symbols by grepping, for example ‘ U ‘ (undefined symbols):U The_external_symbolNow I want to know, how many usages of some symbol is present (statically) in the whole library “lib_the_one.so”. More exact, how many direct calls are there for some external function how many times the external variable is referencedFor example, I want to know that there are

  • owst
    c assembly linker compilation binutils
    I’m hoping someone will be able to help troubleshoot what I think is a linker script issue.I’m encountering a strange problem after adding a call to a new function. Without the function call, my object files link correctly, however, with the new function call added, I get an undefined reference to a symbol from another object file (I’ve verified it is actually present using objdump).Also strangely, with the function call present, if I link all object files first using ld -r (to give a relocatabl

  • Adam
    gnu ld undefined-reference binutils undefined-symbol
    What is the difference between these errors in GNU Binutils ld ? undefined reference undefined symbolI have a good understanding of undefined reference: This occurs for example when the loader cannot find the implementation of a function. I am curious to know the cause of undefined symbol.

Web site is in building