<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[task_struct的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/task_struct</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; task_struct]]></copyright><item><title><![CDATA[vim cscope配置]]></title><link>https://blog.csdn.net/task_struct/article/details/127658755</link><guid>https://blog.csdn.net/task_struct/article/details/127658755</guid><author>task_struct</author><pubDate>Wed, 02 Nov 2022 20:51:25 +0800</pubDate><description><![CDATA[vim cscope配置]]></description><category></category></item><item><title><![CDATA[RISC-V GCC默认链接脚本]]></title><link>https://blog.csdn.net/task_struct/article/details/127352122</link><guid>https://blog.csdn.net/task_struct/article/details/127352122</guid><author>task_struct</author><pubDate>Sun, 16 Oct 2022 19:53:49 +0800</pubDate><description><![CDATA[RISC-V 链接脚本]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(12) - 抛弃glibc依赖]]></title><link>https://blog.csdn.net/task_struct/article/details/113620997</link><guid>https://blog.csdn.net/task_struct/article/details/113620997</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 22:26:20 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/12%20%E6%8A%9B%E5%BC%83glibc%E4%BE%9D%E8%B5%96

1、目标

上一节，我们已经体会到系统库的复杂。为了保持可控性，我们决定抛弃glibc，构建一个完全可控的应用程序。我们需要两个函数，puts和exit，分别实现日志输出和程序退出。

2、系统调用

应用程序调用系统服务称之为系统调用(system call)，应用程序之间的函数调用称之为库调用]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(11) - 构建可运行程序]]></title><link>https://blog.csdn.net/task_struct/article/details/113620965</link><guid>https://blog.csdn.net/task_struct/article/details/113620965</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 22:24:17 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/11%20%E6%9E%84%E5%BB%BA%E5%8F%AF%E8%BF%90%E8%A1%8C%E7%A8%8B%E5%BA%8F

1、目标

你可能已经注意到，我们前面自定义linker script编译的可执行均无法正常运行。其原因是现代系统有无数的细节需要小心处理。一方面是，printf是系统libc提供的函数，为了保证编译通过我们只是简单得把printf函数屏...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(10) - 表达式]]></title><link>https://blog.csdn.net/task_struct/article/details/113620900</link><guid>https://blog.csdn.net/task_struct/article/details/113620900</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 22:19:49 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/10%20Linker%20Scripts%E4%B8%AD%E7%9A%84%E8%A1%A8%E8%BE%BE%E5%BC%8F

1、常量


_fourk_1 = 4K;
_fourk_2 = 4096;
_fourk_3 = 0x1000;
_fourk_4 = 10000o;


2、符号名


"SECTION" = 9;
"with a space" = "also with]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(09) - VERSION指令]]></title><link>https://blog.csdn.net/task_struct/article/details/113620623</link><guid>https://blog.csdn.net/task_struct/article/details/113620623</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 22:17:43 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/09%20VERSION%E6%8C%87%E4%BB%A4

1、符号导出版本

符号导出版本在version script中指明.



VER_1.1 {
        math_pow;
};


VER_1.2 {
       math_pow;
} VER_1.1;



2、函数别名绑定


__asm__(".symver math_pow_old, ma...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(08) - PHDRS指令]]></title><link>https://blog.csdn.net/task_struct/article/details/113620555</link><guid>https://blog.csdn.net/task_struct/article/details/113620555</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 22:02:22 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/08%20PHDRS%E6%8C%87%E4%BB%A4

1、格式预览


PHDRS
{
  name type [ FILEHDR ] [ PHDRS ] [ AT ( address ) ]
        [ FLAGS ( flags ) ] ;
}


ld默认一组phdrs。如果自定义了自己的PHDRS，那么默认的phdrs将会被屏蔽。

FI...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(07) - MEMORY指令]]></title><link>https://blog.csdn.net/task_struct/article/details/113620132</link><guid>https://blog.csdn.net/task_struct/article/details/113620132</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 21:37:04 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/07%20MEMORY%E6%8C%87%E4%BB%A4

1、完整格式


MEMORY
  {
    name [(attr)] : ORIGIN = origin, LENGTH = len
    …
  }


2、attr

attr
			描述
		R
			只读
		W
			读写
		X
			可执行
		A
			可分配
		I
			初始
		L
			同I
		!]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(06) - SECTIONS指令]]></title><link>https://blog.csdn.net/task_struct/article/details/113620073</link><guid>https://blog.csdn.net/task_struct/article/details/113620073</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 21:33:26 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/06%20SECTIONS%E6%8C%87%E4%BB%A4

1、指令预览


*section* [address] [(type)] :
  [AT(lma)]
  [ALIGN(section_align) | ALIGN_WITH_INPUT]
  [SUBALIGN(subsection_align)]
  [constraint]
  {
    output-section]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(05) - 符号值分配]]></title><link>https://blog.csdn.net/task_struct/article/details/113619932</link><guid>https://blog.csdn.net/task_struct/article/details/113619932</guid><author>task_struct</author><pubDate>Wed, 03 Feb 2021 21:27:03 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/05%20%E7%AC%A6%E5%8F%B7%E5%80%BC%E5%88%86%E9%85%8D

1、简单符号值

第一节已经对符号做了描述，并且提及链接脚本也是符号的产生原因之一。符号支持如下运算。


symbol = expression ; symbol += expression ; symbol -= expression ; symbol *= expre...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(04) - 简要链接指令]]></title><link>https://blog.csdn.net/task_struct/article/details/113576103</link><guid>https://blog.csdn.net/task_struct/article/details/113576103</guid><author>task_struct</author><pubDate>Tue, 02 Feb 2021 22:51:42 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/04%20%E7%AE%80%E8%A6%81%E9%93%BE%E6%8E%A5%E6%8C%87%E4%BB%A4

1、指定程序入口

使用ENTRY指令指定程序入口。格式为如下。


ENTRY(symbol)


其它指定入口方式如下。

使用命令行-e 参数
	使用ENTRY(symbol)指令
	平台相关定义，众多平台为start
	.text段...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(03) - 简要示例]]></title><link>https://blog.csdn.net/task_struct/article/details/113576011</link><guid>https://blog.csdn.net/task_struct/article/details/113576011</guid><author>task_struct</author><pubDate>Tue, 02 Feb 2021 22:46:58 +0800</pubDate><description><![CDATA[1、测试示例

这一小节我们演示linker script的简单用法。

第一节中我们创建了一个测试用例，并编译连接出一个能够运行的可执行程序app。使用readelf命令，获取可执行程序的segment分配如下图。


 $ readelf -l app  

Elf file type is DYN (Shared object file)
Entry point 0x580
There are 9 program headers, starting at offset ...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(02) - 格式]]></title><link>https://blog.csdn.net/task_struct/article/details/113575872</link><guid>https://blog.csdn.net/task_struct/article/details/113575872</guid><author>task_struct</author><pubDate>Tue, 02 Feb 2021 22:39:09 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/02%20%E6%A0%BC%E5%BC%8F

1、注释写法

linker script使用/* */方式表达注释。

2、文件名写法

当包含文件时，你可以直接键入文件名。如果文件名包含特殊字符，需要使用引号包裹文件名。
...]]></description><category></category></item><item><title><![CDATA[GNU链接脚本(01) - 基本概念]]></title><link>https://blog.csdn.net/task_struct/article/details/113575737</link><guid>https://blog.csdn.net/task_struct/article/details/113575737</guid><author>task_struct</author><pubDate>Tue, 02 Feb 2021 22:35:23 +0800</pubDate><description><![CDATA[原文：https://github.com/iDalink/ld-linker-script/tree/master/01%20%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5

1、概述

Linux编译产出文件种类包括目标文件、可执行文件、动态链接文件、目标归档文件。这些文件格式常为ELF格式。

文件类型
			英文名
			扩展名
			生成指令
		目标文件
			object file
			.o
			gcc -C ...
		可执行文件
			exec...]]></description><category></category></item><item><title><![CDATA[openocd编译安装]]></title><link>https://blog.csdn.net/task_struct/article/details/113094980</link><guid>https://blog.csdn.net/task_struct/article/details/113094980</guid><author>task_struct</author><pubDate>Sun, 24 Jan 2021 19:05:49 +0800</pubDate><description><![CDATA[openocd编译

1. 简介

openocd是open on chip debugger的简称，一般想脱离windows系统的一些调试工具进行片上调试的话，都会选择用这个。

在这里只记录本人在ubuntu20.04上的编译安装的过程，以便日后查询。

2. 下载

可以在openocd官网下载源码包:https://sourceforge.net/projects/openocd/

3. 安装依赖

因为想尽量编一个较全的版本，所以需要安装一些调试协议的依赖库：

sudo apt install]]></description><category></category></item><item><title><![CDATA[gnu链接脚本lds介绍]]></title><link>https://blog.csdn.net/task_struct/article/details/83474672</link><guid>https://blog.csdn.net/task_struct/article/details/83474672</guid><author>task_struct</author><pubDate>Sun, 28 Oct 2018 14:55:46 +0800</pubDate><description><![CDATA[因为这篇文章被转载了好多手，已经不知道原文在哪里了，觉的看中文比较舒适，就转过来了，感谢原文作者。

连接脚本的格式
====================

连接脚本是文本文件.

你写了一系列的命令作为一个连接脚本. 每一个命令是一个带有参数的关键字,或者是一个对符号的赋值. 你可
以用分号分隔命令. 空格一般被忽略.

文件名或格式名之类的字符串一般可以被直接键入. 如果文件名含有特殊字符...]]></description><category></category></item><item><title><![CDATA[Linux内核源码分析(八)--启动内存分配器]]></title><link>https://blog.csdn.net/task_struct/article/details/80218604</link><guid>https://blog.csdn.net/task_struct/article/details/80218604</guid><author>task_struct</author><pubDate>Sun, 06 May 2018 21:25:31 +0800</pubDate><description><![CDATA[在Linux内核启动的过程中需要分配内存，但完整的内存管理子系统还没有初始化，此时需要一个简单的内存管理办法，就是我们要介绍的启动内存分配器。启动内存分配器主要用位图来管理物理页的分配，一个页的分配状态可以用一个位来表示。所以初始化启动内存分配器的时候，肯定要知道总共有多少物理页，起始的物理页在哪里等这样的信息。所以我们可以猜想有以下特征的一个数据结构:(1)   包含一个记录物理页分配状态的位图...]]></description><category></category></item><item><title><![CDATA[Linux内核源码分析(七)--start_kernel之local_irq_disable]]></title><link>https://blog.csdn.net/task_struct/article/details/79204077</link><guid>https://blog.csdn.net/task_struct/article/details/79204077</guid><author>task_struct</author><pubDate>Tue, 30 Jan 2018 11:40:52 +0800</pubDate><description><![CDATA[﻿﻿
local_irq_disable的定义有两处，和跟踪调试有关，由CONFIG_TRACE_IRQFLAGS_SUPPORT宏开关加以区分，当关闭这个宏的时候我怀疑2.6的内核定义是颠倒的，翻看最新的4.14.15的内核发现果然是定义颠倒了。不过我们主要关注的是宏开关打开后的定义。
local_irq_disable宏定义在include/linux/irqflags.h文件中。
#d]]></description><category></category></item><item><title><![CDATA[Linux内核源码分析(六)--start_kernel之lockdep_init]]></title><link>https://blog.csdn.net/task_struct/article/details/79169071</link><guid>https://blog.csdn.net/task_struct/article/details/79169071</guid><author>task_struct</author><pubDate>Fri, 26 Jan 2018 10:02:39 +0800</pubDate><description><![CDATA[这个函数比较短，这里直接贴出来。
void lockdep_init(void)
{
        int i;
        /*
         * Some architectures have their own start_kernel()
         * code which calls lockdep_init(), while we also
      ]]></description><category></category></item><item><title><![CDATA[Linux内核源码分析(五)--start_kernel之unwind_init]]></title><link>https://blog.csdn.net/task_struct/article/details/79169042</link><guid>https://blog.csdn.net/task_struct/article/details/79169042</guid><author>task_struct</author><pubDate>Fri, 26 Jan 2018 09:57:10 +0800</pubDate><description><![CDATA[我的内核中该函数为空，暂时保留，以后结合其他版本内核及设计思想再做分析。]]></description><category></category></item></channel></rss>