1 /* Audit module loaded by tst-audit23.
2 Copyright (C) 2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
27 la_version (unsigned int version
)
40 la_activity (uintptr_t *cookie
, unsigned int flag
)
42 fprintf (stderr
, "%s: %d %"PRIxPTR
"\n", __func__
, flag
, (uintptr_t) cookie
);
46 la_objopen (struct link_map
*map
, Lmid_t lmid
, uintptr_t *cookie
)
48 const char *l_name
= map
->l_name
[0] == '\0' ? "mainapp" : map
->l_name
;
49 fprintf (stderr
, "%s: %"PRIxPTR
" %s %"PRIxPTR
" %ld\n", __func__
,
50 (uintptr_t) cookie
, l_name
, map
->l_addr
, lmid
);
52 struct map_desc_t
*map_desc
= malloc (sizeof (struct map_desc_t
));
56 map_desc
->lname
= strdup (l_name
);
57 map_desc
->laddr
= map
->l_addr
;
58 map_desc
->lmid
= lmid
;
60 *cookie
= (uintptr_t) map_desc
;
66 la_objclose (uintptr_t *cookie
)
68 struct map_desc_t
*map_desc
= (struct map_desc_t
*) *cookie
;
69 fprintf (stderr
, "%s: %"PRIxPTR
" %s %"PRIxPTR
" %ld\n", __func__
,
70 (uintptr_t) cookie
, map_desc
->lname
, map_desc
->laddr
,