#1582·mold

Feature Request: Support for PROVIDE_HIDDEN in linker scripts

Author: agrieveCreated May 14, 2026Updated May 14, 2026

Chrome uses this script: https://source.chromium.org/chromium/chromium/src/+/main:base/android/library_loader/anchor_functions.lds

# Define symbols that point to the start and end of the .text section.
PROVIDE_HIDDEN(linker_script_start_of_text = ADDR(.text));

# The `malloc_hook` section comes from function attributes set in
# third_party/abseil-cpp. See http://crbug.com/352317042.
PROVIDE_HIDDEN(linker_script_end_of_text =
    ADDR(.text) + SIZEOF(.text) + SIZEOF(malloc_hook));

I think linker_script_end_of_text is different from _etext due to the extra section, and that linker_script_start_of_text is different than __executable_start.

Note: readelf -S libchrome.so shows:

  [17] .text             PROGBITS        0000000000f84000 f84000 9a6a41c 00 AXo  0   0 16384
  [18] malloc_hook       PROGBITS        000000000a9ee41c a9ee41c 0008a4 00  AX  0   0  4