ld文件定义符号的使用

. = ALIGN(16);
_heap_start = .;
_heap_end = ORIGIN(DRAM_ADDR) + LENGTH(DRAM_ADDR);
_heap_len = _heap_end - _heap_start;

extern void *_heap_start;
extern void *_heap_len;

void test_addr(void) {
    printf("heap start 0x%p len %p \n", (char*)&_heap_start, (size_t)&_heap_len);
}

_heap_start, _heap_len的值需要 用&引用

你可能感兴趣的:(c++,servlet,java)