Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Revamp rt/sections_android.d#178

Merged
kinke merged 9 commits intoldcfrom
sections_android
Mar 17, 2020
Merged

Revamp rt/sections_android.d#178
kinke merged 9 commits intoldcfrom
sections_android

Conversation

@kinke
Copy link
Member

@kinke kinke commented Mar 10, 2020

[Relevant portions will be upstreamed. Actual rt/sections_android.d still TODO; just preparational work for now.]

printf(" path: %s\n", path.ptr);
printf(" base: %p\n", object.baseAddress);
}
}
Copy link
Member Author

@kinke kinke Mar 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g.:

DSO name: runtime/druntime-test-runner-shared
    path: /home/martin/build-ldc/runtime/druntime-test-runner-shared
    base: 0x5589831e6000
DSO name: linux-vdso.so.1
    path: [vdso]
    base: 0x7ffdeb9f7000
DSO name: /home/martin/build-ldc/lib/libdruntime-ldc-unittest-shared.so.91
    path: /home/martin/build-ldc/lib/libdruntime-ldc-unittest-shared.so.2.0.91
    base: 0x7ff21166b000
DSO name: /lib/x86_64-linux-gnu/libgcc_s.so.1
    path: /lib/x86_64-linux-gnu/libgcc_s.so.1
    base: 0x7ff211453000
DSO name: /lib/x86_64-linux-gnu/libc.so.6
    path: /lib/x86_64-linux-gnu/libc-2.27.so
    base: 0x7ff211062000
DSO name: /lib64/ld-linux-x86-64.so.2
    path: /lib/x86_64-linux-gnu/ld-2.27.so
    base: 0x7ff211b53000
DSO name: /lib/x86_64-linux-gnu/libm.so.6
    path: /lib/x86_64-linux-gnu/libm-2.27.so
    base: 0x7ff210cc4000
DSO name: /lib/x86_64-linux-gnu/libpthread.so.0
    path: /lib/x86_64-linux-gnu/libpthread-2.27.so
    base: 0x7ff210aa5000
DSO name: /lib/x86_64-linux-gnu/librt.so.1
    path: /lib/x86_64-linux-gnu/librt-2.27.so
    base: 0x7ff21089d000
DSO name: /lib/x86_64-linux-gnu/libdl.so.2
    path: /lib/x86_64-linux-gnu/libdl-2.27.so
    base: 0x7ff210699000

printf("not mapped into memory\n");
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g.:

section   0                                 not mapped into memory
section   1 .interp                         0x55a0f1d27270 - 0x55a0f1d2728c
section   2 .note.ABI-tag                   0x55a0f1d2728c - 0x55a0f1d272ac
section   3 .note.gnu.build-id              0x55a0f1d272ac - 0x55a0f1d272d0
section   4 .gnu.hash                       0x55a0f1d272d0 - 0x55a0f1d273b0
section   5 .dynsym                         0x55a0f1d273b0 - 0x55a0f1d278d8
section   6 .dynstr                         0x55a0f1d278d8 - 0x55a0f1d280da
section   7 .gnu.version                    0x55a0f1d280da - 0x55a0f1d28148
section   8 .gnu.version_r                  0x55a0f1d28148 - 0x55a0f1d281a8
section   9 .rela.dyn                       0x55a0f1d281a8 - 0x55a0f1d28358
section  10 .rela.plt                       0x55a0f1d28358 - 0x55a0f1d284f0
section  11 .init                           0x55a0f1d284f0 - 0x55a0f1d28507
section  12 .plt                            0x55a0f1d28510 - 0x55a0f1d28630
section  13 .plt.got                        0x55a0f1d28630 - 0x55a0f1d28638
section  14 .text                           0x55a0f1d28640 - 0x55a0f1d28d72
section  15 .fini                           0x55a0f1d28d74 - 0x55a0f1d28d7d
section  16 .rodata                         0x55a0f1d28d80 - 0x55a0f1d28df0
section  17 .eh_frame_hdr                   0x55a0f1d28df0 - 0x55a0f1d28e9c
section  18 .eh_frame                       0x55a0f1d28ea0 - 0x55a0f1d291d8
section  19 .gcc_except_table               0x55a0f1d291d8 - 0x55a0f1d291f8
section  20 .tbss                           0x55a0f1f29cd8 - 0x55a0f1f29ce8
section  21 .init_array                     0x55a0f1f29cd8 - 0x55a0f1f29ce8
section  22 .fini_array                     0x55a0f1f29ce8 - 0x55a0f1f29cf8
section  23 .dynamic                        0x55a0f1f29cf8 - 0x55a0f1f29f28
section  24 .got                            0x55a0f1f29f28 - 0x55a0f1f2a000
section  25 .data                           0x55a0f1f2a000 - 0x55a0f1f2a058
section  26 __minfo                         0x55a0f1f2a058 - 0x55a0f1f2a060
section  27 .bss                            0x55a0f1f2a060 - 0x55a0f1f2a070
section  28 .comment                        not mapped into memory
section  29 .symtab                         not mapped into memory
section  30 .strtab                         not mapped into memory
section  31 .shstrtab                       not mapped into memory

@kinke kinke force-pushed the sections_android branch 3 times, most recently from b0eb432 to f576379 Compare March 11, 2020 00:24
@kinke kinke changed the title [WIP] Revamp rt/sections_android.d Revamp rt/sections_android.d Mar 11, 2020
@kinke kinke force-pushed the sections_android branch 3 times, most recently from 79c5cc4 to e8d2ff2 Compare March 11, 2020 21:02
@kinke kinke requested a review from redstar as a code owner March 11, 2020 21:02
@kinke kinke force-pushed the sections_android branch from e8d2ff2 to 2f786aa Compare March 11, 2020 21:56
kinke added 9 commits March 14, 2020 16:03
As alternative to get ahold of the ELF file path in case name() doesn't
return a full path.
…med sections

E.g., this allows to conveniently scan for multiple named sections in a
single pass.
... instead of relying on magic compiler symbols `_tls{start,end}` and
the apparently problematic magic linker symbol `_end`.

Also eagerly allocate the TLS per-thread-block to speed-up TLS lookup.
…canning

As it apparently doesn't always end up at the start of the data segment,
e.g., with the gold linker, see
ldc-developers/ldc#3350 (comment).

It should be rather small in most cases, especially in comparison to the
ranges on the heap, so just don't bother.
@kinke kinke force-pushed the sections_android branch from 2f786aa to ff89130 Compare March 14, 2020 15:09
@kinke kinke merged commit ff89130 into ldc Mar 17, 2020
@kinke kinke deleted the sections_android branch March 17, 2020 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant