]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Remove redundant _dl_map_segments declaration from dl-load.h
authorWANG Rui <wangrui@loongson.cn>
Tue, 14 Apr 2026 15:14:33 +0000 (15:14 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Thu, 16 Apr 2026 13:34:49 +0000 (13:34 +0000)
The function `_dl_map_segments` is defined in `<dl-map-segments.h>`,
which provides the canonical implementation (optionally overridden
by sysdeps variants). All call sites include `<dl-map-segments.h>`
directly, so declaring `_dl_map_segments` in `dl-load.h` is unnecessary.

Keeping a static prototype in `dl-load.h` can trigger
-Wunused-function errors when the header is included by translation
units that do not include `<dl-map-segments.h>` and do not reference
`_dl_map_segments`. Since glibc builds with `-Werror`, this results
in build failures [1].

Remove the redundant declaration from `dl-load.h` to avoid these
spurious warnings and keep the declaration colocated with the
definition as intended.

[1] https://ci.linaro.org/job/tcwg_glibc_build--master-aarch64-precommit/4624/artifact/artifacts/artifacts.precommit/notify/mail-body.txt

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
elf/dl-load.h

index dbc29b335e8494c4fd48c870e407bc3540367e07..897c4034c5eb14fe8027955ab84c733892cf0a60 100644 (file)
@@ -109,14 +109,15 @@ _dl_postprocess_loadcmd (struct link_map *l, const ElfW(Ehdr) *header,
 
    The file <dl-map-segments.h> defines this function.  The canonical
    implementation in elf/dl-map-segments.h might be replaced by a sysdeps
-   version.  */
+   version.
+
 static const char *_dl_map_segments (struct link_map *l, int fd,
                                      const ElfW(Ehdr) *header, int type,
                                      const struct loadcmd loadcmds[],
                                      size_t nloadcmds,
                                      const size_t maplength,
                                      bool has_holes,
-                                     struct link_map *loader);
+                                     struct link_map *loader); */
 
 /* All the error message strings _dl_map_segments might return are
    listed here so that different implementations in different sysdeps