0

While building binutils gas and gold I'm facing the following error. I've changed the gcc versions namely gcc-7,gcc-8 and gcc-11 for several times. After that I'm facing this error. The code:

echo -e "${BLUE}===================== build gas && gold ===========================${NC}"
echo

if [ ! -f ${PWD_PATH}/succeed/binutils ]; then
    wget -c 'https://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.xz'
    tar xvJf binutils-2.30.tar.xz
    rm -r binutils-2.30/gas
    rm -r binutils-2.30/gold

    cp -r ${SRC_PATH}/binutils/gas-2.30 ${GAS_DIR}

    cp -r ${SRC_PATH}/binutils/gold-2.30 ${GOLD_DIR}

    cp $PROTODEF_DIR/$C_HDR $GAS_DIR

    cp $PROTODEF_DIR/$CC_HDR ${GOLD_DIR}/
    cp $PROTODEF_DIR/$PROTO_C ${GOLD_DIR}/

    eval "cd $PWD_PATH/binutils-2.30 && mkdir -p build && cd build"

    CFLAGS="`pkg-config --cflags 'libprotobuf-c >= 1.0.0'`" LDFLAGS=`pkg-config --libs 'libprotobuf-c >= 1.0.0'` \
            ../configure --enable-gold --prefix=${PWD_PATH}/executable_binutils \
            --disable-werror --enable-shared \
             --enable-ld=default \
         --enable-plugins    \
             --enable-64-bit-bfd \
             --with-system-zlib \
            && make -j$(nproc)
            # && make install
    echo "done" > ${PWD_PATH}/succeed/binutils
fi

echo
echo -e "${GREEN}[*] build gas&&gold succeed!${NC}"

GAS_PATH=$PWD_PATH/binutils-2.30/build/gas/as-new
GOLD_PATH=$PWD_PATH/binutils-2.30/build/gold/ld-new

# get gcc-8.1.0
GCC_PATH="$PWD_PATH/gcc-8.1.0"
# GCC_EXE_PATH="$PWD_PATH/gcc_executable"
#GCC_EXE_PATH=""
GCC_BUILD_PATH="$PWD_PATH/build_gcc"
GCC_EXE_PATH="$PWD_PATH/executable_gcc"


# soft link gas
eval " sudo cp /usr/bin/as /usr/bin/as.old"
echo

How to fix the following error:

/usr/local/bin/ld: error: symbols.o: multiple definition of 'jmp_table'
/usr/local/bin/ld: ehopt.o: previous definition here
/usr/local/bin/ld: error: bbInfoHandle.o: multiple definition of 'jmp_table'
/usr/local/bin/ld: ehopt.o: previous definition here
/usr/local/bin/ld: error: obj-elf.o: multiple definition of 'jmp_table'
/usr/local/bin/ld: ehopt.o: previous definition here
NobinPegasus
  • 545
  • 2
  • 16
  • Track down the definition of `jmp_table` in the source code. My crystal ball tells me that it will be in a header file, although why that is is an open question. – Paul Sanders Apr 02 '23 at 23:16
  • After changing the gcc version. It's giving this error. I'm trying to build binutils gas and gold. Added the code that's generating the error in the question. – NobinPegasus Apr 02 '23 at 23:50
  • Side question: why `eval "cd $PWD_PATH/binutils-2.30 && mkdir -p build && cd build"`, `eval " sudo cp ...`? Why not just execute commands? – dimich Apr 03 '23 at 00:46

0 Answers0