簡體   English   中英

鏈接的ELF文件不包含符號

[英]linked ELF file contains no symbols

我將AVR C源代碼編譯為目標文件。 這些對象包含調試符號:

~ avr-nm code.co: 00000000 T ClockInit32MhzXtal 00000000 T CopyDataToSensors 00000000 T FindSensors U I2CInitMaster 00000000 T PC_UsartInit 00000000 T ReadFromSensorSettings 00000000 T ResetAndAlignSampleClock 00000000 T SampleClockTimerInit 00000000 T SendDataToPC ...

將所有文件鏈接到一個文件時,盡管我指定了-g選項,但這些符號似乎丟失了:

~ /usr/local/bin/avr-gcc -O1 -lm -Wall -Wstrict-prototypes -Wl,--gc-sections -Wl,-g -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -DF_CPU=32000000 -mmcu=atxmega128a1u file1.co file2.co -o program.elf /usr/local/opt/avr-binutils/bin/avr-ld: warning: cannot find entry symbol arch_paths_first; defaulting to 0000000000000000 ~ avr-nm program.elf avr-nm: program.elf: no symbols

怎么會這樣? 鏈接器是否應在鏈接文件中創建帶有調試信息的新符號表?

avr-gcc: gcc version 4.9.3 (GCC) avr-ld: GNU ld (GNU Binutils) 2.25

-Wl,-search_paths_first標志由CLion添加。 但是,它不是有效的avr-gcc標志,而是典型的OS X標志。 編譯器試圖找到第一個現有的匹配項-Wl,-s 即帶狀符號。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM