linker

Homemade Kernel linker global variables and inline Strings cannot be accessed

点点圈 提交于 2020-01-15 15:16:28
问题 I have followed some tutorials on the web and created my own kernel. It is booting on GRUB with QEMU succesfully. But I have the problem described in this SO question, and I cannot solve it. I can have that workaround described, but I also need to use global variables, it would make the job easier, but I do not understand what should I change in linker to properly use global variables and inline strings. main.c struct grub_signature { unsigned int magic; unsigned int flags; unsigned int

Homemade Kernel linker global variables and inline Strings cannot be accessed

我们两清 提交于 2020-01-15 15:16:07
问题 I have followed some tutorials on the web and created my own kernel. It is booting on GRUB with QEMU succesfully. But I have the problem described in this SO question, and I cannot solve it. I can have that workaround described, but I also need to use global variables, it would make the job easier, but I do not understand what should I change in linker to properly use global variables and inline strings. main.c struct grub_signature { unsigned int magic; unsigned int flags; unsigned int

Change in static library used by other static library

流过昼夜 提交于 2020-01-15 12:27:30
问题 I have 2 library files, lib1.a and lib2.a in my project. Lib1.a is using lib2.a . I have given source code of lib2.a but I don't have source code of lib1.a. For my project I changed lib2.a lets say I add a local variable inside a function. My question, function names didn't changed, do I need to recompile lib1.a with changed lib2.a ? Is there anyway I tell to linker "lib1.a should use new lib2.a" without source code of lib1.a ? 回答1: If it's just something like an added local variable as you

relocation entry in linking (C programming)

房东的猫 提交于 2020-01-15 12:22:29
问题 still struggling to understand the relocation entry in Relocatable Object Files, let's say I have this simple C program: //main1.c void functionTest(); functionTest(){ ... } int main() { functionTest(); return 0; } my questions are: Q1. since everything is known to main1, so there is no relocation entry in .rel.text or .rel.data section of main1.o, is my understanding correct? Q2. below is a picture illustrates how DLL works, for libc.so, everything is known(it has all definitions just like

How to statically link to MSVCP120.dll in VS2013

时光怂恿深爱的人放手 提交于 2020-01-15 12:15:31
问题 When I launch .exe it gives error MSVCP120.dll is missing. How do I add statically link to project. Is it in Linker? Do I need to give path to MSVCP120.dll? 回答1: In general, you should not use static CRT linking as it creates a number of potential problems, security risks, and servicing concerns. You can require the VC++ REDIST package to be run (which requires admin rights) to install the 'system' version, you can use the VC++ MSM modules with your own MSI installer, or you can just use side

Function Call: Labels into memory addresses

主宰稳场 提交于 2020-01-15 10:39:09
问题 I have difficulty to understand the correct sequence of events. When a program written in abstract language is compiled, it is translated into machine code. Subsequently, only after the program has run, it is loaded into the ram, in the code segment. At this point, each instruction in the program will be on a specific memory address. When a function is called in assembly, the Call statement is typically followed by a label. I assume this label will be replaced with the function's memory

Mono mkbundle tool unable to create binary with complaint that output file is unavailable

可紊 提交于 2020-01-15 06:20:13
问题 As per suggestions from this thread on running C# apps sans .NET I've compiled my app using mono. I built the original app using the latest Visual C# .NET Express Edition. It runs fine on .NET on Windows. I then opened up Cygwin and navigated to my source where I compiled the project again, under mono using the following command: $ mcs <myProjectHere>.cs This produces MyProject.exe, which can be run from within Cygwin with success, and can be run from the Window command line successfully.

Unresolved Externals When Compiling With FreeType

血红的双手。 提交于 2020-01-15 05:12:06
问题 I am compiling a program in Visual Studio 2015, using the FreeType Library. Before, I had used the same project to compile a static library with my own Font class (and many other things), using the library. All was well, and the class worked great. However, I recently changed the project to a Windows application, by changing Properties -> General -> Configuration Type to Application (.exe) . That way, I could make a program and edit the code at the same time, without copying all of the 20

How do you link a static library to a shared library

自作多情 提交于 2020-01-15 03:57:07
问题 I'm trying to link a static library to a shared library via a command like g++ -shared obj.o archive.a -o libLib.so But at run time I keep getting unresolved system that should be link at compile time from archive.a. I've tried g++ -shared obj.o -Wl,-Bstatic archive.a -Wl,-Bdynamic -o libLib.so and g++ -shared obj.o -Wl,-whole-archive archive.a -Wl,-no-whole-archive -o libLib.so with no success. I feel like I'm missing something basic here... 回答1: You practically cannot (i.e. should never )

Visual Studio 2012: exclude compiled file from linking

旧城冷巷雨未停 提交于 2020-01-15 03:26:12
问题 I have a simple C language project with a few files being compiled. These are compiled to .obj files and then linked together. So far so good, now I need to exclude one of these files from linking. I know this is quite unusual but this is exactly what I need: to compile a file but not link it to the project's output file. Using Visual Studio 2012. I have no idea where the linker grabs the files to link although I've been looking to various places in project properties and the vcxproj file. It