小编KK-*_*KK-的帖子

size和objdump报告文本段的不同大小

我已经试过这一点,但卡住了以下问题的答案在hello_world-1.c

#include<stdio.h>
int main(void)
{
    printf("Hello world\n");
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

执行的命令:

[kishore@localhost-localdomain ~]$ gcc -Wall -Wextra -c hello_world-1.c
[kishore@localhost-localdomain ~]$ gcc -o hello_world-1 hello_world-1.o
[kishore@localhost-localdomain ~]$ size hello_world-1 hello_world-1.o

    text    data    bss     dec    hex    filename
    1222     280      4    1506    5e2    hello_world-1
     139       0      0     139     8b    hello_world-1.o

[kishore@localhost-localdomain ~]$ objdump -h hello_world-1.o

    hello_world-1.o:     file format elf32-i386

    Sections:
    Idx Name          Size      VMA       LMA       File off  Algn
      0 .text         0000003b  00000000  00000000  00000034  2**0
                      CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE …
Run Code Online (Sandbox Code Playgroud)

c linux gcc

6
推荐指数
1
解决办法
4017
查看次数

在什么情况下“Openwrt”优于“Buildroot”框架?

我对 Buildroot 和 OpenWrt 感到困惑。我的意思是在哪种情况下会选择 OpenWrt 而不是 Buildroot。

根据我的理解,Buildroot 和 OpenWrt 之间只有 2 个区别

  1. OpenWrt 提供了 buildroot 不可用的包管理器(opkg)。

  2. OpenWrt 为大多数网络相关设备(路由器、交换机等)提供了大量的包支持。

如果我的项目不需要任何包管理器,但我想要网络支持,那么我可以选择 Build root over OpenWrt,对吗?是否无法在 Buildroot 本身中构建与网络相关的包?

我的意思是如果包管理器不是问题,我们可以继续使用 buildroot 本身,对吗?有没有必要选择OpenWrt?

如果我错了,谁能解决 buildroot 失败而 Openwrt 获胜的情况?

我的意思是有可能用 Buildroot 本身来实现 OpenWrt 正在做的事情(为网络相关硬件构建固件映像)。我观察到 Buildroot 和 OpenWrt 的 init 进程(早期用户空间)行为是不同的。

  • 在 Buildroot 中,将读取 init 脚本etc/inittabinit.d执行其下的脚本。
  • 在 Openwrt 中procd是 init 脚本 ( rc.common),它将运行 init.d 下列出的脚本以及rc.d.

如果我尝试使用 Buildroot 为 OpenWrt 支持的固件生成映像,这会产生任何影响吗?

openwrt embedded-linux buildroot

5
推荐指数
1
解决办法
1194
查看次数

标签 统计

buildroot ×1

c ×1

embedded-linux ×1

gcc ×1

linux ×1

openwrt ×1