What does this GCC error "... relocation truncated to fit..." mean?
I am programming the host side of a host-accelerator system. The host runs on the PC under Ubuntu Linux and communicates with the embedded hardware via a USB connection. The communication is performed...
View Articlei686-elf-gcc produces 64-Bit file instead of 32-Bit?
I was following the osdev barebones tutorial and made a custom Makefile to it, but when I ran make kernel to compile the system into a .bin file, I ran into an error while linking.Linker...
View Articlegcc won't compile SDL C Program (undefined reference to SDL functions)
I recently moved to linux and i'm having an issue with compiling SDL C programs using gcc.The command i'm using:gcc `sdl-config --cflags --libs` -o main main.c Even by seperating sdl-config flags:gcc...
View Articlellvm: file format not recognized; treating as linker script
I'm trying to cross compile the Google Cloud Platform IoT SDK but I'm running into:file format not recognized; treating as linker script. The compiler command is auto generated but I can't see what's...
View ArticleHow to prevent "relocation truncated to fit: R_AARCH64_PREL32 against...
When playing with creating baremetal executables, I hit this error:main.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text' collect2: error: ld returned 1 exit status I...
View Articleundefined reference to `WinMain` while compiling my own kernel
I've started writing my very own kernel and am developing on Windows 10.I am using the following tools:gcc 8.1.0 elf x86_64 for compiling my C code, and for linking. I am using this Windows...
View ArticleMac OS X R error “ld: framework not found CoreFoundation”
I need to recompile some old functions to work R again (I had no problem with them back in 2016). Here are the commands and the error msg:system("R CMD SHLIB rk4_mod_r.f90 derive_rossler.f90...
View Articleundefined reference to getdelim() error (Windows) (C Language)
I am trying to work with getdelim() function which apperantly is the preferred method with getline() over fgets(). However, when I try to run the code below, I get undefined reference to getdelim()...
View ArticleGCC C compiler (gcc -Wall -o foo.c foo.c )
When I type to my terminal:gcc -Wall -o foo.c foo.c After that foo.c is deleted. There is no reason to type this but does anybody know why this happens?
View Articleerror: unknown type name ‘FILE’
I am making a function which is just writes "hello" to a file. I have put it in a different file and included its header in the program.But gcc is giving an error namely: error: unknown type name...
View ArticleCompiler stops optimizing unused string away when adding characters
I am curious why the following piece of code:#include <string> int main() { std::string a = "ABCDEFGHIJKLMNO"; } when compiled with -O3 yields the following code:main: # @main xor eax, eax ret (I...
View Articlegcc error message: stray '\XXX' in program
I've started learning Assembly, and I have two files: main.c #include <stdio.h> int assembly(void); int main(void) { printf("Resultado: %d\n", assembly()); return 0; } and assembly.asm global...
View ArticleUsing gtest with gcc cpp, got error - collect2: error: ld returned 1 exit status
Source code:#include <stdio.h> #include <gtest/gtest.h> int main() { return 0; } Error message:happyjoo@D:~$ gcc test.cpp /tmp/cctruZ9h.o: In function...
View Articleinstruction repeated twice when decoded into machine language,
Am basically learning how to make my own instruction in the X86 architecture, but to do that I am understanding how they are decoded and and interpreted to a low level language, By taking an example of...
View ArticleSIGSEGV raised by 32 bit application vs 64 bit applicationn
I've been learning buffer overflows and noticed something strange. void vuln() { char buf[180]; gets(buf); puts(buf); return; } int main() { __gid_t egid; setvbuf(stdout, 0x0, 2, 0); egid = getegid();...
View ArticleHow can I call printf normally in assembly without @PLT but just call printf...
I want to call printf in assembly and link it using gcc -l option with standard library, But it says: Symbol `printf' causes overflow in R_X86_64_PC32 relocation Segmentation fault (core dumped) this...
View Article32-bit absolute addresses no longer allowed in x86-64 Linux?
64 bit Linux uses the small memory model by default, which puts all code and static data below the 2GB address limit. This makes sure that you can use 32-bit absolute addresses. Older versions of gcc...
View ArticleHow can I compile a static c++ library from MediaPipe (it uses bazel) to use...
I'm trying to integrate MediaPipe (https://github.com/google/mediapipe) which uses the google build system Bazel. I'm trying to figure out how to get a static library out of it. I've searched around...
View ArticleDisabling all AVX512 extensions
I need to disable all AVX512 extensions in gcc-compiled code. The reason is that Valgrind chokes on AVX512 instructions. Is there a way to do it with a single flag? I know how to disable each extension...
View ArticleIs there any package management system for MinGW+MSYS?
I am trying to compile some open source libraries in MinGW+MSYS. During the configure phase, I kept seeing some 3rd party libraries are missing.For now, my solution is to download the source of the...
View Article