0
  "   ˆl–Ãa¾”*j"Tâ€nà\¸ÐTÅ£Áƒh¹À¿      0
  7   ˆ943_•I|¥‰ÓMdœv ©ƒ&íK<óo¬a–Ãa¾”*j"Tâ€nà\¸Ð”Å£Á ¯    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>Index of /FSS-BCZ/root/usr/local/lib64/perl5/5.32/auto/Mock</title>
 </head>
 <body>
<h1>Index of /FSS-BCZ/root/usr/local/lib64/perl5/5.32/auto/Mock</h1>
  <table>
   <tr><th valign="top">&nbsp;</th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr>
   <tr><th colspan="5"><hr></th></tr>
<tr><td valign="top">&nbsp;</td><td><a href="/FSS-BCZ/root/usr/local/lib64/perl5/5.32/auto/">Parent Directory</a>       </td><td>&nbsp;</td><td align="right">  - </td><td>&nbsp;</td></tr>
<tr><td valign="top">&nbsp;</td><td><a href="Config/">Config/</a>                </td><td align="right">2024-10-22 13:00  </td><td align="right">  - </td><td>&nbsp;</td></tr>
   <tr><th colspan="5"><hr></th></tr>
</table>
</body></html>
  +   ˆl–äY>”TÔD¨ 	Å�rãO©‹FÿÄ„ |?_†I|¥�+ÀÃ ?÷     // SPDX-License-Identifier: GPL-2.0-only
/*
 * recordmcount.c: construct a table of the locations of calls to 'mcount'
 * so that ftrace can find them quickly.
 * Copyright 2009 John F. Reiser <jreiser@BitWagon.com>.  All rights reserved.
 *
 * Restructured to fit Linux format, as well as other updates:
 *  Copyright 2010 Steven Rostedt <srostedt@redhat.com>, Red Hat Inc.
 */

/*
 * Strategy: alter the .o file in-place.
 *
 * Append a new STRTAB that has the new section names, followed by a new array
 * ElfXX_Shdr[] that has the new section headers, followed by the section
 * contents for __mcount_loc and its relocations.  The old shstrtab strings,
 * and the old ElfXX_Shdr[] array, remain as "garbage" (commonly, a couple
 * kilobytes.)  Subsequent processing by /bin/ld (or the kernel module loader)
 * will ignore the garbage regions, because they are not designated by the
 * new .e_shoff nor the new ElfXX_Shdr[].  [In order to remove the garbage,
 * then use "ld -r" to create a new file that omits the garbage.]
 */

#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <getopt.h>
#include <elf.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#ifndef EM_AARCH64
#define EM_AARCH64	183
#define R_AARCH64_NONE		0
#define R_AARCH64_ABS64	257
#endif

#define R_ARM_PC24		1
#define R_ARM_THM_CALL		10
#define R_ARM_CALL		28

#define R_AARCH64_CALL26	283

static int fd_map;	/* File descriptor for file being modified. */
static int mmap_failed; /* Boolean flag. */
static char gpfx;	/* prefix for global symbol name (sometimes '_') */
static struct stat sb;	/* Remember .st_size, etc. */
static const char *altmcount;	/* alternate mcount symbol name */
static int warn_on_notrace_sect; /* warn when section has mcount not being recorded */
static void *file_map;	/* pointer of the mapped file */
static void *file_end;	/* pointer to the end of the mapped file */
static int file_updated; /* flag to state file was changed */
static void *file_ptr;	/* current file pointer location */

static void *file_append; /* added to the end of the file */
static size_t file_append_size; /* how much is added to end of file */

/* Per-file resource cleanup when multiple files. */
static void file_append_cleanup(void)
{
	free(file_append);
	file_append = NULL;
	file_append_size = 0;
	file_updated = 0;
}

static void mmap_cleanup(void)
{
	if (!mmap_failed)
		munmap(file_map, sb.st_size);
	else
		free(file_map);
	file_map = NULL;
}

/* ulseek, uwrite, ...:  Check return value for errors. */

static off_t ulseek(off_t const offset, int const whence)
{
	switch (whence) {
	case SEEK_SET:
		file_ptr = file_map + offset;
		break;
	case SEEK_CUR:
		file_ptr += offset;
		break;
	case SEEK_END:
		file_ptr = file_map + (sb.st_size - offset);
		break;
	}
	if (file_ptr < file_map) {
		fprintf(stderr, "lseek: seek before file\n");
		return -1;
	}
	return file_ptr - file_map;
}

static 