binutils

Is there a way to unhide hidden-visibility symbols with GNU binutils?

邮差的信 提交于 2019-12-23 04:05:12
问题 I'm working on a script to make uClibc usable on an existing glibc-targetted gcc/binutils toolchain, and the one problem I'm left with is that pthread_cancel needs to dlopen libgcc_s.so.1 . The version supplied with the host gcc is linked to depend on glibc, so I'm instead using ld 's -u option to pull in the needed symbols (and their dependencies) from libgcc_eh.a to make a replacement libgcc_s.so.1 : gcc -specs uclibc.specs -Wl,-u,_Unwind_Resume -Wl,-u,__gcc_personality_v0 \ -Wl,-u,_Unwind

Is there a way to unhide hidden-visibility symbols with GNU binutils?

送分小仙女□ 提交于 2019-12-23 04:03:05
问题 I'm working on a script to make uClibc usable on an existing glibc-targetted gcc/binutils toolchain, and the one problem I'm left with is that pthread_cancel needs to dlopen libgcc_s.so.1 . The version supplied with the host gcc is linked to depend on glibc, so I'm instead using ld 's -u option to pull in the needed symbols (and their dependencies) from libgcc_eh.a to make a replacement libgcc_s.so.1 : gcc -specs uclibc.specs -Wl,-u,_Unwind_Resume -Wl,-u,__gcc_personality_v0 \ -Wl,-u,_Unwind

How to decide the base address for the location counter “.” when VMA and LMA are different?

筅森魡賤 提交于 2019-12-22 11:18:36
问题 According to the ld manual on the special symbol ., i.e.the Location Counter. Note: . actually refers to the byte offset from the start of the current containing object. Normally this is the SECTIONS statement, whose start address is 0, hence . can be used as an absolute address. If . is used inside a section description however, it refers to the byte offset from the start of that section, not an absolute address. Thus in a script like this: SECTIONS { . = 0x100 .text: { *(.text) . = 0x200 }

How to create stub shared libraries on Linux

梦想的初衷 提交于 2019-12-22 04:57:08
问题 Let's first explain what I mean with a stub shared library: a shared library that can be used to link against (w/ a certain interface provided by a real library) but don't contain the actual code (so has no functionality). Along with the header files it provides everything needed to develop against the library. Stubs can allow linking to a certain library without having the code available, but also for compatibility it can be useful to link against a stub of a certain library. See for example

Elegant way to set base address of ELF image with Linux binutils?

巧了我就是萌 提交于 2019-12-20 03:01:05
问题 For a personal project, I need to write an executable that loads at a non-default memory address. From this SO question, I know I can set the entry address for an ELF and modify the section addresses manually so that the executable is effectively based at some address I choose. However, the answer suggests that this is only works if I don't glibc initialization (which I need for this project), and setting section memory addresses every time I compile would be difficult (not to mention tedious

What is the “__gmon_start__” symbol?

假装没事ソ 提交于 2019-12-18 12:49:28
问题 I'm compiling this code with gcc hello.c -o hello -O3 : #include <stdio.h> int main(void) { printf("Hello world\n"); return 0; } and when I list the relocations I get: test@southpark$ readelf -r hello | grep gmon 080495a4 00000106 R_386_GLOB_DAT 00000000 __gmon_start__ 080495b4 00000107 R_386_JUMP_SLOT 00000000 __gmon_start__ When I list the symbols in this file I get: test@southpark$ readelf -s hello | grep gmon 1: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__ 48: 00000000 0 NOTYPE WEAK

Why were GNU binutils and GDB merged as one package?

 ̄綄美尐妖づ 提交于 2019-12-12 10:38:05
问题 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git See, especially, the tags section. What was the rationale behind this decision? Does the merge affect the suggested way to build latest binutils and GDB? (In fact when I checked out binutils-2_25_1 and ran make all && make install , I got gdb as well.) 回答1: I did the conversion. The reason I made them a joined repository was partly historical and partly practical. Historically gdb and binutils have pretty much always been together. They

How to build GCC 4.8.x on Mac OS X host for MIPS target

♀尐吖头ヾ 提交于 2019-12-12 08:27:24
问题 I am trying to build GCC / binutils for a MIPS target platform on a Mac OS X host running (10.9) x86_64. I have downloaded the latest version of binutils and GCC to my knowledge, and I have also installed GCC 4.8.2 via homebrew. However, so far I have been unsuccessful in building GCC / binutils for MIPS arch on a OS X host. I tried setting the CC environment variable to point to the gcc version installed via homebrew, but that doesn't seem to fix the problem. Has anyone created a step by

Use of ifdef in gas assembly language

怎甘沉沦 提交于 2019-12-12 05:38:58
问题 I have following assembly file mov.s .text .macro test_3 and $3,%eax .endm movz: movzb %al,%ax movzb (%eax),%ax movzb %al,%eax movzb (%eax),%eax .ifdef test_3 movzb33 %al,%rax movzb (%rax),%rax .endif command as -o dump.o movz In this code I want to test ifdef in assembly language so I have defined macro test_3. According to my understanding it should print message Error: no such instruction: 'movzb33 %al,%rax' when I use assembler but it is not going inside ifdef so what is the problem? 回答1:

compiling error with make command std::__cxx11

拟墨画扇 提交于 2019-12-11 19:09:59
问题 At first, my Makefile is written as: .SUFFIXES: .c .cpp CC = g++ -fopenmp # CFLAGS = -c -Wall -D_I386 -D_UNIX -O2 -fPIC -Wno-deprecated -Wno-unused-result -std=c++0x -Wno-sign-compare CFLAGS = -c -O2 -Wall -D_I386 -D_UNIX -fPIC -Wno-unused-result -std=c++11 -Wno-sign-compare -D_GLIBCXX_USE_CXX11_ABI=0 LFLAGS = -shared -O2 -o LIBS = -llmi -lblas -lboost_regex -lpthread -lleveldb MAINDIR = ../../../ LIBDIR = ${MAINDIR}lib/ LD_PATH = -L${LIBDIR} INCLUDEDIR = ${MAINDIR}include/Lheader IN_PATH =