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