[llvm] [bolt] Add cmake c,cxx,asm,linker flags (PR #68358)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 16:42:08 PDT 2023
hiraditya wrote:
After this patch readelf output is different.
$ cat base.readelf
```
There are 45 section headers, starting at offset 0x60b240:
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 0000000000000318 000318 00001c 00 A 0 0 1
[ 2] .note.gnu.property NOTE 0000000000000338 000338 000020 00 A 0 0 8
[ 3] .note.gnu.build-id NOTE 0000000000000358 000358 000024 00 A 0 0 4
[ 4] .note.ABI-tag NOTE 000000000000037c 00037c 000020 00 A 0 0 4
[ 5] .hash HASH 00000000000003a0 0003a0 00002c 04 A 7 0 8
[ 6] .gnu.hash GNU_HASH 00000000000003d0 0003d0 000024 00 A 7 0 8
[ 7] .dynsym DYNSYM 00000000000003f8 0003f8 000090 18 A 8 1 8
[ 8] .dynstr STRTAB 0000000000000488 000488 000088 00 A 0 0 1
[ 9] .gnu.version VERSYM 0000000000000510 000510 00000c 02 A 7 0 2
[10] .gnu.version_r VERNEED 0000000000000520 000520 000030 00 A 8 1 8
[11] .rela.dyn RELA 0000000000000550 000550 0000c0 18 A 7 0 8
[12] .init PROGBITS 0000000000001000 001000 000017 00 AX 0 0 4
[13] .plt PROGBITS 0000000000001020 001020 000010 10 AX 0 0 16
[14] .plt.got PROGBITS 0000000000001030 001030 000008 08 AX 0 0 8
[15] .bolt.org.text PROGBITS 0000000000001040 001040 0000f7 00 AX 0 0 16
[16] .fini PROGBITS 0000000000001138 001138 000009 00 AX 0 0 4
[17] .rodata PROGBITS 0000000000002000 002000 000004 04 AM 0 0 4
[18] .bolt.org.eh_frame_hdr PROGBITS 0000000000002004 002004 000024 00 A 0 0 4
[19] .bolt.org.eh_frame PROGBITS 0000000000002028 002028 000088 00 A 0 0 8
[20] .init_array INIT_ARRAY 0000000000003df0 002df0 000008 08 WA 0 0 8
[21] .fini_array FINI_ARRAY 0000000000003df8 002df8 000008 08 WA 0 0 8
[22] .dynamic DYNAMIC 0000000000003e00 002e00 0001c0 10 WA 8 0 8
[23] .got PROGBITS 0000000000003fc0 002fc0 000028 08 WA 0 0 8
[24] .got.plt PROGBITS 0000000000003fe8 002fe8 000018 08 WA 0 0 8
[25] .data PROGBITS 0000000000004000 003000 000010 00 WA 0 0 8
[26] .tm_clone_table PROGBITS 0000000000004010 003010 000000 00 WA 0 0 8
[27] .bss NOBITS 0000000000004010 003010 000008 00 WA 0 0 1
[28] .text PROGBITS 0000000000400000 400000 000274 00 AX 0 0 2097152
[29] .text.injected PROGBITS 0000000000400280 400280 00006f 00 AX 0 0 64
[30] .eh_frame PROGBITS 0000000000600000 600000 0000b8 00 A 0 0 8
[31] .bolt.instr.counters PROGBITS 0000000000601000 601000 00103e 00 WA 0 0 4096
[32] .text.bolt.extra.1 PROGBITS 0000000000602040 602040 0060ba 00 AX 0 0 16
[33] .rodata.str1.1.bolt.extra.1 PROGBITS 00000000006080fa 6080fa 00006e 00 A 0 0 1
[34] .rodata.str1.16.bolt.extra.1 PROGBITS 0000000000608170 608170 000066 00 A 0 0 16
[35] .rodata.bolt.extra.1 PROGBITS 00000000006081d8 6081d8 000008 00 A 0 0 8
[36] .data.bolt.extra.1 PROGBITS 0000000000609000 609000 000010 00 WA 0 0 8
[37] .bss.bolt.extra.1 PROGBITS 0000000000609010 609010 001020 00 WA 0 0 16
[38] .eh_frame_hdr PROGBITS 000000000060a030 60a030 00002c 00 A 0 0 1
[39] .comment PROGBITS 0000000000000000 60a05c 00001e 01 MS 0 0 1
[40] .symtab SYMTAB 0000000000000000 60a080 000738 18 41 56 8
[41] .strtab STRTAB 0000000000000000 60a7b8 00033a 00 0 0 1
[42] .shstrtab STRTAB 0000000000000000 60aaf2 000236 00 0 0 1
[43] .bolt.instr.tables NOTE 0000000000000000 60ad28 00037c 00 0 0 1
[44] .note.bolt_info NOTE 0000000000000000 60b0a4 000194 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
R (retain), l (large), p (processor specific)
```
$ cat mod.readelf
```
There are 75 section headers, starting at offset 0x60bad0:
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 0000000000000318 000318 00001c 00 A 0 0 1
[ 2] .note.gnu.property NOTE 0000000000000338 000338 000020 00 A 0 0 8
[ 3] .note.gnu.build-id NOTE 0000000000000358 000358 000024 00 A 0 0 4
[ 4] .note.ABI-tag NOTE 000000000000037c 00037c 000020 00 A 0 0 4
[ 5] .hash HASH 00000000000003a0 0003a0 00002c 04 A 7 0 8
[ 6] .gnu.hash GNU_HASH 00000000000003d0 0003d0 000024 00 A 7 0 8
[ 7] .dynsym DYNSYM 00000000000003f8 0003f8 000090 18 A 8 1 8
[ 8] .dynstr STRTAB 0000000000000488 000488 000088 00 A 0 0 1
[ 9] .gnu.version VERSYM 0000000000000510 000510 00000c 02 A 7 0 2
[10] .gnu.version_r VERNEED 0000000000000520 000520 000030 00 A 8 1 8
[11] .rela.dyn RELA 0000000000000550 000550 0000c0 18 A 7 0 8
[12] .init PROGBITS 0000000000001000 001000 000017 00 AX 0 0 4
[13] .plt PROGBITS 0000000000001020 001020 000010 10 AX 0 0 16
[14] .plt.got PROGBITS 0000000000001030 001030 000008 08 AX 0 0 8
[15] .bolt.org.text PROGBITS 0000000000001040 001040 0000f7 00 AX 0 0 16
[16] .fini PROGBITS 0000000000001138 001138 000009 00 AX 0 0 4
[17] .rodata PROGBITS 0000000000002000 002000 000004 04 AM 0 0 4
[18] .bolt.org.eh_frame_hdr PROGBITS 0000000000002004 002004 000024 00 A 0 0 4
[19] .bolt.org.eh_frame PROGBITS 0000000000002028 002028 000088 00 A 0 0 8
[20] .init_array INIT_ARRAY 0000000000003df0 002df0 000008 08 WA 0 0 8
[21] .fini_array FINI_ARRAY 0000000000003df8 002df8 000008 08 WA 0 0 8
[22] .dynamic DYNAMIC 0000000000003e00 002e00 0001c0 10 WA 8 0 8
[23] .got PROGBITS 0000000000003fc0 002fc0 000028 08 WA 0 0 8
[24] .got.plt PROGBITS 0000000000003fe8 002fe8 000018 08 WA 0 0 8
[25] .data PROGBITS 0000000000004000 003000 000010 00 WA 0 0 8
[26] .tm_clone_table PROGBITS 0000000000004010 003010 000000 00 WA 0 0 8
[27] .bss NOBITS 0000000000004010 003010 000008 00 WA 0 0 1
[28] .text PROGBITS 0000000000400000 400000 000274 00 AX 0 0 2097152
[29] .text.injected PROGBITS 0000000000400280 400280 00006f 00 AX 0 0 64
[30] .eh_frame PROGBITS 0000000000600000 600000 0000b8 00 A 0 0 8
[31] .bolt.instr.counters PROGBITS 0000000000601000 601000 00103e 00 WA 0 0 4096
[32] .text.memcpy.bolt.extra.1 PROGBITS 0000000000602040 602040 0000a8 00 AX 0 0 16
[33] .text.memmove.bolt.extra.1 PROGBITS 00000000006020f0 6020f0 000178 00 AX 0 0 16
[34] .text.memset.bolt.extra.1 PROGBITS 0000000000602270 602270 00006e 00 AX 0 0 16
[35] .text.memcmp.bolt.extra.1 PROGBITS 00000000006022e0 6022e0 000031 00 AX 0 0 16
[36] .text.__bolt_instr_clear_counters.bolt.extra.1 PROGBITS 0000000000602320 602320 0000fb 00 AX 0 0 16
[37] .text.__bolt_instr_data_dump.bolt.extra.1 PROGBITS 0000000000602420 602420 003471 00 AX 0 0 16
[38] .text._ZN12_GLOBAL__N_16assertEbPKc.bolt.extra.1 PROGBITS 00000000006058a0 6058a0 0000f4 00 AX 0 0 16
[39] .text._ZN12_GLOBAL__N_118visitCallFlowEntryERNS_17CallFlowEntryBaseEiPNS_20ProfileWriterContextE.bolt.extra.1 PROGBITS 00000000006059a0 6059a0 00020e 00 AX 0 0 16
[40] .text._Z12watchProcessv.bolt.extra.1 PROGBITS 0000000000605bb0 605bb0 000209 00 AX 0 0 16
[41] .text._ZN12_GLOBAL__N_111openProfileEv.bolt.extra.1 PROGBITS 0000000000605dc0 605dc0 000462 00 AX 0 0 16
[42] .text.__bolt_instr_setup.bolt.extra.1 PROGBITS 0000000000606230 606230 00042b 00 AX 0 0 16
[43] .text.__bolt_instr_indirect_call.bolt.extra.1 PROGBITS 0000000000606660 606660 00004c 00 AX 0 0 16
[44] .text.__bolt_instr_indirect_tailcall.bolt.extra.1 PROGBITS 00000000006066b0 6066b0 00004c 00 AX 0 0 16
[45] .text.instrumentIndirectCall.bolt.extra.1 PROGBITS 0000000000606700 606700 00010e 00 AX 0 0 16
[46] .text.__bolt_instr_start.bolt.extra.1 PROGBITS 0000000000606810 606810 000040 00 AX 0 0 16
[47] .text.__bolt_instr_fini.bolt.extra.1 PROGBITS 0000000000606850 606850 00002d 00 AX 0 0 16
[48] .text._ZN12_GLOBAL__N_18__get_pcEv.bolt.extra.1 PROGBITS 0000000000606880 606880 000005 00 AX 0 0 16
[49] .text._ZN12_GLOBAL__N_116BumpPtrAllocator8allocateEm.bolt.extra.1 PROGBITS 0000000000606890 606890 000228 00 AX 0 0 16
[50] .text._ZN12_GLOBAL__N_15GraphD2Ev.bolt.extra.1 PROGBITS 0000000000606ac0 606ac0 0000c8 00 AX 0 0 16
[51] .text._ZN12_GLOBAL__N_116BumpPtrAllocator10deallocateEPv.bolt.extra.1 PROGBITS 0000000000606b90 606b90 0001fc 00 AX 0 0 16
[52] .text._ZN12_GLOBAL__N_112serializeLocERKNS_20ProfileWriterContextEPcNS_8LocationEj.bolt.extra.1 PROGBITS 0000000000606d90 606d90 00020e 00 AX 0 0 16
[53] .text._ZN12_GLOBAL__N_115SimpleHashTableINS_17CallFlowEntryBaseELj11939ELj233EE15getOrAllocEntryEmRNS_16BumpPtrAllocatorE.bolt.extra.1 PROGBITS 0000000000606fa0 606fa0 0003f2 00 AX 0 0 16
[54] .text._ZN12_GLOBAL__N_119visitIndCallCounterERNS_24SimpleHashTableEntryBaseEiiPNS_20ProfileWriterContextE.bolt.extra.1 PROGBITS 00000000006073a0 6073a0 0005f5 00 AX 0 0 16
[55] .text._ZN12_GLOBAL__N_115SimpleHashTableINS_24SimpleHashTableEntryBaseELj7ELj7EE14forEachElementIJiiPNS_20ProfileWriterContextEEEEvPFvRS1_DpT_EjPS1_S8_.bolt.extra.1 PROGBITS 00000000006079a0 6079a0 00008c 00 AX 0 0 16
[56] .text._ZN12_GLOBAL__N_115SimpleHashTableINS_24SimpleHashTableEntryBaseELj7ELj7EE14forEachElementIJEEEvPFvRS1_DpT_EjPS1_S6_.bolt.extra.1 PROGBITS 0000000000607a30 607a30 0001ba 00 AX 0 0 16
[57] .text._ZN12_GLOBAL__N_115SimpleHashTableINS_17CallFlowEntryBaseELj11939ELj233EE14forEachElementIJiPNS_20ProfileWriterContextEEEEvPFvRS1_DpT_EjPS1_S8_.bolt.extra.1 PROGBITS 0000000000607bf0 607bf0 000099 00 AX 0 0 16
[58] .text._ZN12_GLOBAL__N_115SimpleHashTableINS_24SimpleHashTableEntryBaseELj7ELj7EE15getOrAllocEntryEmRNS_16BumpPtrAllocatorE.bolt.extra.1 PROGBITS 0000000000607c90 607c90 00046a 00 AX 0 0 16
[59] .rodata.str1.1.bolt.extra.1 PROGBITS 00000000006080fa 6080fa 00006e 00 A 0 0 1
[60] .rodata.str1.16.bolt.extra.1 PROGBITS 0000000000608170 608170 000066 00 A 0 0 16
[61] .rodata._ZN12_GLOBAL__N_114MaskAllSignalsE.bolt.extra.1 PROGBITS 00000000006081d8 6081d8 000008 00 A 0 0 8
[62] .data._ZN12_GLOBAL__N_121GlobalIndCallCountersE.bolt.extra.1 PROGBITS 0000000000609000 609000 000008 00 WA 0 0 8
[63] .data._ZN12_GLOBAL__N_123GlobalWriteProfileMutexE.bolt.extra.1 PROGBITS 0000000000609008 609008 000008 00 WA 0 0 8
[64] .bss._ZN12_GLOBAL__N_115TextBaseAddressE.bolt.extra.1 PROGBITS 0000000000609010 609010 000008 00 WA 0 0 8
[65] .bss._ZN12_GLOBAL__N_121GlobalMetadataStorageE.bolt.extra.1 PROGBITS 0000000000609018 609018 000008 00 WA 0 0 8
[66] .bss._ZN12_GLOBAL__N_111GlobalAllocE.bolt.extra.1 PROGBITS 0000000000609020 609020 000008 00 WA 0 0 8
[67] .bss._ZZN12_GLOBAL__N_113getBinaryPathEvE10TargetPath.bolt.extra.1 PROGBITS 0000000000609030 609030 001000 00 WA 0 0 16
[68] .eh_frame_hdr PROGBITS 000000000060a030 60a030 00002c 00 A 0 0 1
[69] .comment PROGBITS 0000000000000000 60a05c 00001e 01 MS 0 0 1
[70] .symtab SYMTAB 0000000000000000 60a080 000738 18 71 56 8
[71] .strtab STRTAB 0000000000000000 60a7b8 00033a 00 0 0 1
[72] .shstrtab STRTAB 0000000000000000 60aaf2 000ad6 00 0 0 1
[73] .bolt.instr.tables NOTE 0000000000000000 60b5c8 00037c 00 0 0 1
[74] .note.bolt_info NOTE 0000000000000000 60b944 000184 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
R (retain), l (large), p (processor specific)
```
https://github.com/llvm/llvm-project/pull/68358
More information about the llvm-commits
mailing list