Quantcast
Browsing all 22048 articles
Browse latest View live

How to make section physical address to zero in GCC elf file?

Currently I am working on PowerPC target with GCC and Greenhills compiler, I found the Greenhills compiler can always generate sections with all zero pyhsical address of sections in elf, Here is sample...

View Article


wrong version off gcc in my sytem for a python build

I am trying to install a software package in my linux environment in a local directory . The package requires gcc version 4.9 or later and python 3.5 or later as . I have python 3.7 on my environment,...

View Article


What versions of GCC is supported by RHEL7.2?

I'm looking to install a newer versions of GCC in my RHEL7.2 environment. The default GCC version is 4.8.5, but I need at least 5.1 or newer. I'm wondering if there's a only up to a certain version...

View Article

Why does each member function get its own .text.* section?

I understand that name mangling happens. What I don't understand is this:class MyClass{public: int doStuff(int a){ return a+1; }};int main(){ MyClass myclass; myclass.doStuff(2); return 0;}> g++ -c...

View Article

simple linker.ld file broke the executable MinGW

I have tried a simple linker script in MinGW using the following commands gcc -Wall -c boot.cld boot.o -o boot.exe -T linker.ldboot.c containsint my_main(void){ return 0x1000;}linker.ld...

View Article


Why sum of symbol size much less than ".text" section size?

I'm debugging a dynamic shared library in linux, the name of the library is libMNN.so.Here is the size of all sections of libMNN.so got by size -A ./libMNN.so :section size addr.note.gnu.build-id 36...

View Article

Image may be NSFW.
Clik here to view.

Problem with method call, especially calling Assembly From C

I'm trying to write a small OS, but am having a problem when I call my assembly function from C.[BITS 16]extern initcall initmov SI, msgcall printstrcall printstrjmp $global printstrprintstr: mov AL,...

View Article

Does specifying "-nostdlib" in GCC defines some preprocessor macro?

In GCC, if we were to specify -ffreestanding, GCC will define __STDC_HOSTED__ to 0. Is there a similar macro defined/undefined for specifying -nostdlib in GCC/Clang?

View Article


what does extra symbol and assembly code mean?

I have a simple c file:// filename: test.cvoid fun() {}Then I compile test.c to libtest.so using commands:gcc -shared -fPIC -Wl,--gc-sections -ffunction-sections -fdata-sections -o libtest.so...

View Article


Using openmp on windows with mingw. Cannot find -lpthread

I have a CMake project which is using OpenMP and works on linux. When I went to compile it on my windows machine it looked like CMake was having trouble finding the openmp flags for mingw's gcc. I...

View Article

I wonder if my code can be more optimized

I'm student and taking Microprocessor class.Because of COVID-19, I had gotten a simple mid-term assignment writing inline assembly code of QuickSort.Today, I got a score of this assignment and the...

View Article

Can gcc's linker fold multiple instantiations of a static function in a C...

The embedded C code I'm writing has numerous (i.e. >100) small static accessor functions defined in headers, but I'd be uncomfortable moving them out of the headers because the overall code clarity...

View Article

Devtoolset 3 with GCC 4.9.2 causing segmentation faults

I have a CentOS 6.10 with GCC 4.4.7 and Devtoolset 3, which has GCC 4.9.2. Basically, I have this C++ project that runs perfectly fine when built using GCC 4.4.7 but results to a segmentation fault...

View Article


Is Google's Golang an interpreter or compiler?

I have been researching Golang and I see that it has a compiler.But is it compiling Go into assembly level code or just converting it into BYTECODES and then calling that compilation? I mean, even in...

View Article

Cannot modify data segment register. When tried General Protection Error is...

I have been trying to create an ISR handler following this tutorial by James Molloy but I got stuck. Whenever I throw a software interrupt, general purpose registers and the data segment register is...

View Article


using gcc and getting core dumped [duplicate]

hi i was trying to use this function to take out palindromes and make a new string with them but i get core dumpedi don't see any problem with code really it is complicated because i use so many...

View Article

internal error in mingw32_gt_pch_use_address, at...

internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address. I get this error while compiling a c++ program in sublime-text 3.How...

View Article


Ubuntu 14.04 install gcc-4.5 and g++4.5

I'm trying to install gcc-4.5 and g++-4.5 on Ubuntu 14.04 sudo apt-get install gcc-4.5 g++-4.5 gcc-multilib g++-multilib but the following errors appeared:Package gcc-4.5 is not available, but is...

View Article

gcc/g++ using linkerflag "-lSDL2"

acordingly to lazyfoos sdl tutorial https://lazyfoo.net/tutorials/SDL/01_hello_SDL/linux/cli/index.phpi setup sdl2. (and it runs with the given Terminal command) "g++ 01_hello_SDL.cpp -w -lSDL2 -o...

View Article

Why does this work with G++ and not CLANG? [closed]

Trying to learn C/C++.Why does this work when use g++ and not clang? But it works when I convert the same program to plain C and use gcc and clang...The code:#include <iostream>#ifndef...

View Article
Browsing all 22048 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>