GNU Toolchain is the de facto standard of IT industrial and has been improved by comprehensive open source contributions. In this session, it is expected to cover the mechanism of compiler driver, system interaction (take GNU/Linux for example), linker, C runtime library, and the related dynamic linker. Instead of analyzing the system design, the session is use case driven and illustrated progressively.
The code compares pointers and arrays in C by printing their sizes and string lengths. When a string literal is assigned to a pointer, sizeof(pointer) returns the pointer size rather than the string length, while sizeof(array) returns the full array size including the null terminator. strlen(pointer) and strlen(array) both return the string length excluding the null terminator. When an array is passed to a function, it converts to a pointer and sizeof then returns the pointer size rather than full array size.
Memory Mapping Implementation (mmap) in Linux KernelAdrian Huang
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
Jim Huang (jserv) from 0xlab.org prepared the technical training for ARM and SoC. In part I, it introduced the overview of ARM architecture, family, ISA feature, SoC overview, and several practical approaches to Xscale SoC as example.
The document provides an overview of kernel crash dump analysis including:
- The tools and data required such as the crash utility, kernel symbol files, vmcore files
- How to install and use these components
- Basic crash commands to analyze system, memory, storage, and network subsystems
- How to dynamically load crash extension modules to add custom commands
The document discusses how a "Hello World" program works behind the scenes. It covers topics like compilation, linking, executable file formats, loading programs into memory, and process creation. The key points are:
1) A C program is compiled into an object file, then linked with library files to create an executable. The linker resolves symbols and relocates addresses.
2) Executable files use formats like ELF that contain machine code, data, symbol tables, and sections. Object files have a similar format.
3) When a program runs, the OS loads pages of the executable into memory as needed and sets up the process with its own virtual address space.
4) System calls
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
The document summarizes the use of LLVM for code generation when recompiling Nintendo games as native games. LLVM provides a full compiler infrastructure that can be used to generate code for various platforms from a common intermediate representation (LLVM bitcode). The document discusses using LLVM for code generation from 6502 assembly to generate native code for emulation. Optimizations available through LLVM are also discussed.
Introduce Brainf*ck, another Turing complete programming language. Then, try to implement the following from scratch: Interpreter, Compiler [x86_64 and ARM], and JIT Compiler.
It is the presentation file used by Jim Huang (jserv) at OSDC.tw 2009. New compiler technologies are invisible but highly integrated around our world, and we can enrich the experience via facilitating LLVM.
Linux uses /proc/iomem as a "Rosetta Stone" to establish relationships between software and hardware. /proc/iomem maps physical memory addresses to devices, similar to how the Rosetta Stone helped map Egyptian hieroglyphs to Greek and decode ancient Egyptian texts. This virtual file allows the kernel to interface with devices by providing address translations between physical and virtual memory spaces.
This document provides an introduction to GDB (GNU Debugger) including what it is, why it is useful, basic GDB commands, and examples of using GDB to debug a C program. Key points include:
- GDB is an interactive debugger that allows debugging of C/C++ programs.
- It helps developers find bugs by allowing them to watch/modify variables, determine why programs fail, and change program flow.
- Basic GDB commands demonstrated include breakpoints, backtraces, printing variables, and stepping through code.
- An example program is debugged using GDB to step through functions and view variable values.
This document discusses using the GNU Debugger (GDB) to debug programs. It begins with an introduction to GDB and why it is useful. Examples are then provided of using GDB for interactive debugging, examining core dumps, patching binaries, and advanced tricks. A real-world case study demonstrates using GDB to debug a crash in the GNU C library by examining assembly code and source-level debugging with debug symbols. The document concludes by mentioning another case study involving hijacking file descriptors in GDB.
This document provides an overview of porting Linux to a new ARM platform. It discusses setting up the GNU toolchain, kernel prerequisites and configuration, creating machine-specific files and code, initializing drivers and boot options. Key steps include registering the new machine, adding architecture-specific code and configuration files, initializing I/O mapping and IRQs, and creating an initramfs image to test bootability. References for further information on ARM Linux boot sequences and porting are also provided.
The document summarizes the use of LLVM for code generation when recompiling Nintendo games as native games. LLVM provides a full compiler infrastructure that can be used to generate code for various platforms from a common intermediate representation (LLVM bitcode). The document discusses using LLVM for code generation from 6502 assembly to generate native code for emulation. Optimizations available through LLVM are also discussed.
Introduce Brainf*ck, another Turing complete programming language. Then, try to implement the following from scratch: Interpreter, Compiler [x86_64 and ARM], and JIT Compiler.
It is the presentation file used by Jim Huang (jserv) at OSDC.tw 2009. New compiler technologies are invisible but highly integrated around our world, and we can enrich the experience via facilitating LLVM.
Linux uses /proc/iomem as a "Rosetta Stone" to establish relationships between software and hardware. /proc/iomem maps physical memory addresses to devices, similar to how the Rosetta Stone helped map Egyptian hieroglyphs to Greek and decode ancient Egyptian texts. This virtual file allows the kernel to interface with devices by providing address translations between physical and virtual memory spaces.
This document provides an introduction to GDB (GNU Debugger) including what it is, why it is useful, basic GDB commands, and examples of using GDB to debug a C program. Key points include:
- GDB is an interactive debugger that allows debugging of C/C++ programs.
- It helps developers find bugs by allowing them to watch/modify variables, determine why programs fail, and change program flow.
- Basic GDB commands demonstrated include breakpoints, backtraces, printing variables, and stepping through code.
- An example program is debugged using GDB to step through functions and view variable values.
This document discusses using the GNU Debugger (GDB) to debug programs. It begins with an introduction to GDB and why it is useful. Examples are then provided of using GDB for interactive debugging, examining core dumps, patching binaries, and advanced tricks. A real-world case study demonstrates using GDB to debug a crash in the GNU C library by examining assembly code and source-level debugging with debug symbols. The document concludes by mentioning another case study involving hijacking file descriptors in GDB.
This document provides an overview of porting Linux to a new ARM platform. It discusses setting up the GNU toolchain, kernel prerequisites and configuration, creating machine-specific files and code, initializing drivers and boot options. Key steps include registering the new machine, adding architecture-specific code and configuration files, initializing I/O mapping and IRQs, and creating an initramfs image to test bootability. References for further information on ARM Linux boot sequences and porting are also provided.
This document provides an overview of GNU Make, Autotools, and CMake. It begins with a disclaimer and then outlines the topics to be covered, including GNU Make, Autotools, CMake, comparisons between the tools, and a question and answer section. The document recommends using tabs rather than spaces for indentation in code examples.
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code MeetupJian-Hong Pan
The document introduces several tools for debugging C/C++ programs within a terminal environment, including vimGdb, clewn, pyclewn, Conque GDB, and cgdb. It recommends cgdb as the best option, describing it as a lightweight curses-based interface that splits the screen to simultaneously display source code and the GNU Debugger terminal.
Este documento proporciona información sobre Date A Live, una serie de novelas ligeras que fueron adaptadas a anime. Resume la trama principal, que gira en torno a Shido Itsuka y su habilidad para sellar los poderes de los espíritus causantes de desastres, los cuales deben enamorarse de él. También presenta a los principales personajes humanos y espíritus que aparecen en la historia.
This document discusses dynamically tracing C code using runtime execution logs. It provides tips for building the environment, using the menuconfig system, makefiles, toolchains and runtime tracing with Qemu logs and Linux ftrace. Ftrace in particular allows tracing kernel functions and call graphs to help understand code flow and task relationships when statically tracing C/C++ sources proves difficult due to macros and configurations.
This document provides an overview of Leman Global Partner, a global transportation and logistics company founded in 1900. It operates 25 offices across 6 countries, with 700 employees and partnerships in over 100 countries. The document summarizes Leman's various transportation services, including air, sea, road, express, and project freight, as well as logistics and warehousing solutions. It highlights capabilities like global networks, flexible solutions, temperature-controlled transport, and expertise in industries like pharmaceuticals.
Re-identification of Anomized CDR datasets using Social networlk DataAlket Cecaj
This document discusses re-identifying users across anonymized datasets using social network data. It summarizes related work showing high re-identification rates just from gender, ZIP code and date of birth. The study aims to use social network data to re-identify users in an anonymized call detail records dataset. It describes matching users between the datasets using time and location parameters and probabilistic modeling. The results show the potential and limits of re-identifying users across multiple mobility datasets, and future work is needed to refine the model and address privacy concerns when correlating multiple datasets.
There is a pressing need to distribute accurate timing, i.e., frequency and/or Time of Day (ToD), across Packet Switched Networks (PSNs) for applications such as cellular backhaul. This paper reviews the main issues involved in timing over packet (ToP) demarcation and provides best practices for ToP demarcation and performance monitoring.
13. GNU ld 是啥?問問男人吧
man ld
...
ld combines a number of object and archive files, relocates
their data and ties up symbol references. Usually the last
step in compiling a program is to run ld.
...
ld combines a number of object and archive files, relocates
their data and ties up symbol references. Usually the last
step in compiling a program is to run ld.
...