binutils

How to filter a lot of data with IPC::Open2?

浪尽此生 提交于 2020-01-01 19:12:30
问题 My task is to filter some data from perl script with external utility (the addr2line). The data size is quite large. I need to print a lot of data to stdin of program and read a lot of data back (from stdout of program into my script). Now I do this with IPC::Open2 , but I don't mix reading and writing. Is this legal? Will Open2 buffer any size of data in pipe? My code: my $cmd="addr2line -e $prog_name "; use IPC::Open2; local (*Reader, *Writer); my $pid = open2(\*Reader, \*Writer, $cmd); for

How to compile an assembly file to a raw binary (like DOS .com) format with GNU assembler (as)? [duplicate]

 ̄綄美尐妖づ 提交于 2020-01-01 05:40:11
问题 This question already has answers here : How to generate plain binaries like nasm -f bin with the GNU GAS assembler? (2 answers) Closed 6 months ago . I want to compile this source code in Windows (It just an example): start: NOP NOP When I compile it with NASM or FASM, output file length is 2 bytes. But when I compile it with GNU assembler (as) the output file length is 292 bytes! How to compile an assembly file to a raw binary (like DOS .com) format with GNU assembler (as)? Why I do this? I

Why do STM32 gcc linker scripts automatically discard all input sections from these standard libraries: libc.a, libm.a, libgcc.a?

ⅰ亾dé卋堺 提交于 2019-12-30 06:50:13
问题 From the bottom of any auto-generated STM32CubeMx-generated linker script: /* Remove information from the standard libraries */ /DISCARD/ : { libc.a ( * ) libm.a ( * ) libgcc.a ( * ) } From the GNU Binutils ld (linker script) manual, 3.6.7 Output Section Discarding: The special output section name ‘/DISCARD/’ may be used to discard input sections. Any input sections which are assigned to an output section named ‘/DISCARD/’ are not included in the output file. What do these 3 input object

make error) Undefined reference to std::__cxx11::basic_string

荒凉一梦 提交于 2019-12-24 18:31:35
问题 When I command make , I got errors like this: filter_block.cc:(.text+0x1c4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)' I found some solutions for this error, like adding -D_GLIBCXX_USE_CXX11_ABI=0 , but I don't know how to add the command for make command. The Makefile is written as: .SUFFIXES: .c .cpp CC = g++ -fopenmp CFLAGS = -c -O2 -Wall -D_I386 -D_UNIX -fPIC -Wno-unused-result -std=c++11

How to convert default binutils into binutils-2.26?

不羁岁月 提交于 2019-12-24 08:05:04
问题 When I command "make", then I got an error like this: /usr/bin/ld: ../../../lib//liblmi.a(LMInterface.o): unrecognized relocation (0x2a) in section `.text' This error is caused by earlier version of binutils, and I have binutils like this: GNU ld (GNU Binutils for Ubuntu) 2.24 I installed binutils-2.26 by following commands $ sudo apt-get update $ sudo apt-get install binutils-2.26 But I have a problem, I installed binutils-2.26, but the default binutils version is 2.24, so How can I convert

binutils make error for readelf

耗尽温柔 提交于 2019-12-24 07:34:40
问题 When I run make binutils/readelf I get the following error: In file included from readelf.c:43:0: sysdep.h:23:25: fatal error: alloca-conf.h: No such file or directory #include "alloca-conf.h" What dependency am I missing? How do I just build and compile readelf without making the rest of binutils? 回答1: What has actually happened is that you do not have a Makefile or at least not one defining binutils/readelf target. But since there is a binutils/readelf.c file, make still ran and tried to

gnu-binutils-strings utf-8 instead of utf-16 or ascii

与世无争的帅哥 提交于 2019-12-23 22:48:00
问题 I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible for the program to print out utf-8 strings? if so, which arguments are appropriate? i'm working in a python environment using subprocess and would like to work with the output from gnu-binutils-strings that a subprocess.Popen call would generate through a pipe. 回答1: I'm not experienced with strings , but the version I have (2.21.51.20110605) has an 8-bit encoding option (-eS) that would work with utf-8

Is '.set noat' unsupported for MIPS assembly?

 ̄綄美尐妖づ 提交于 2019-12-23 18:44:51
问题 Currently, I'm learning GNU as, and find a lot useful information in "info as". I found ".set noat" is used in MIPS specified code, but when searching for this directive in "info as", I found its explanation in node "alpha directive", but not in "MIPS Dependent Features". Why? did I miss something in the manual? TIA 回答1: The .set at/noat is a valid construction for MIPS architecture and works the similar way as on Alpha by disabling/enabling warning when $at register is used by user. As

Macports installing binutils

試著忘記壹切 提交于 2019-12-23 17:24:18
问题 I'm trying to install gnu ld, via macports, on Lion. I have already installed gcc 4.6 from macports. However I need to create elf binary form a binary file, which I posted as seperate question here I installed binutils from macports, it seems as though everything went fine, however I did get the following message at the end: Warning: binutils installs files outside the common directory structure. ---> Installing binutils @2.21_0 ---> Activating binutils @2.21_0 Having binutils installed will

Help with linker failer: .gnu.linkonce.t

旧街凉风 提交于 2019-12-23 08:55:28
问题 I'm having trouble linking a shared library using gcc 3.2.3 with binutils 2.18. When I try to link the library I get the following error: .gnu.linkonce.t_... referenced in section .rodata: defined in discarded section .gnu.linkonce.t... I've done a fair amount of googling on this and most places seem to indicate it is a regression introduce in binutils 2.17 and later fixed in 2.18.50, but I was curious if anybody knew if there were any particular workarounds for the issue without having to