something about Compile and Link on Embedded Linux
来源:互联网 发布:普联软件 编辑:程序博客网 时间:2024/06/03 04:09
1 , Compile 流程
2,The `##' preprocessing operator performs token pasting
#define myprintf(format, ...) printf (format, ##__VA_ARGS__)
#define myprintf(args...) myprintf (args)
3, Endian
例: mutil-byte number - register 12 34 56 78
big-endian:
the most significant byte has the lowest address
L H
78 56 34 12
little-endian:
bytes at lower addresses have lower significance
L H
12 34 56 78
4, -rpath=dir
Add a directory to the runtime library search path, 当然也可以用 environment variable LD_RUN_PATH
5, Dynamic loading
dlopen() to load a shared library
dlsym() to find the address of a symbol
6, extern "C"
#ifdef __cplusplus
extern “C” {
#endif
……
#ifdef __cplusplus
}
#endif
When you state that a function has extern "C" linkage, the C++ compiler does not add argument/parameter type information to the name used for linkage
7, Optimize level
-O, -O2, -O3, -Os
8, -D<macro>[=<val>]
Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
9, Attribute extended by GNU
The keyword __attribute__ allows you to specify special attributes when making a
declaration. This keyword is followed by an attribute specification inside double
parentheses
The following attributes are currently defined for functions on all targets:
aligned, alloc_size, noreturn, returns_twice, noinline, noclone,always_inline, flatten, pure, const, nothrow, sentinel,
format, format_arg, no_instrument_function,no_split_stack, section, constructor, destructor, used, unused,
deprecated, weak,malloc, alias, ifunc, warn_unused_result, nonnull, gnu_inline, externally_visible, hot, cold, artificial, error and warning
10, 一些常用指令
ar: Create, modify, and extract from archives
nm: List symbols from object files
objcopy: Copy and translate object files
objdump: Display information from object files
ranlib: Generate index to archive contents
readelf: Display the contents of ELF format files
size: List section sizes and total size
strings: List printable strings from files
strip: Discard symbols
addr2line: Convert addresses to file and line
- something about Compile and Link on Embedded Linux
- Something about Compile error
- Something about cpu and memory hot plug on kvm
- Something about linux
- something about linux Signals
- linux/unix something about $
- something about function on python
- Something about J2EE and .NET
- something about binder and service
- Something about profile and bashrc
- something about bootcmd and bootargs
- how to compile and link static/dynamic library in linux
- NASM Intro - Compile and Link
- GCC Compile and Link options
- something about memory and studying English
- something about code page and character set
- Something about Instance Method and Class Method
- Something about C pointers and arrays
- jQuery学习(一)
- 黑马程序员——java基础之数组与集合之间的点点滴滴
- (转载)maven的用途、核心概念
- TextKit学习(四)通过boundingRectWithSize:options:attributes:context:计算文本尺寸
- oracle sql游标
- something about Compile and Link on Embedded Linux
- 快乐编程的好习惯
- Android Matrix理论与使用详解
- 对treeMap的value 排序
- mime type与content type
- 拓展--求四个最大公约数
- 基于遗传算法和粒子群算法的混合算法实现小老鼠找奶酪问题
- uva 11991 - Easy Problem from Rujia Liu?
- SEO必须搞懂这几个问题