1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

ld.so: Decorate BSS mappings

Decorate BSS mappings with [anon: glibc: .bss <file>], for example
[anon: glibc: .bss /lib/libc.so.6]. The string ".bss" is already used
by bionic so use the same, but add the filename as well. If the name
would be longer than what the kernel allows, drop the directory part
of the path.

Refactor glibc.mem.decorate_maps check to a separate function and use
it to avoid assembling a name, which would not be used later.

Signed-off-by: Petr Malat <oss@malat.biz>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Petr Malat
2025-01-28 11:08:20 +01:00
committed by Adhemerval Zanella
parent a6fbe36b7f
commit 4c43173eba
5 changed files with 83 additions and 16 deletions

View File

@ -19,9 +19,17 @@
#ifndef __SETVMANAME_H
#define __SETVMANAME_H
/* Maximum supported name from initial kernel support, not exported
by user API. */
#define ANON_VMA_NAME_MAX_LEN 80
/* Set the NAME to the anonymous memory map START with size of LEN.
It assumes well-formatted input. */
#if IS_IN(libc) || IS_IN(rtld)
#include <stdbool.h>
bool __is_decorate_maps_enabled (void) attribute_hidden;
void __set_vma_name (void *start, size_t len, const char *name)
attribute_hidden;
#else