* Gordon Messmer:

> On 2026-09-07 5:20 AM, Florian Weimer wrote:
>>   000000000001e740 <putenv>:
>> -   1e740:   f3 0f 1e fa             endbr64
>> +   1e740:   cc                      int3
>> +   1e741:   0f 1e fa                nop    %edx
>>      1e744:  55                      push   %rbp
>>      1e745:  be 3d 00 00 00          mov    $0x3d,%esi
>>      1e74a:  48 89 e5                mov    %rsp,%rbp
>
>
> Before I do any work on a new CI test: How did you generate this diff?

I used the program below to dum /usr/lib64/libc.so.6, and then ran
objdump -d --reloc.

Thanks,
Florian

#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>

struct mapped
{
  void *buffer;
  size_t length;
};

static bool
open_mmap (const char *file, int flags, struct mapped *result)
{
  int fd = open (file, O_RDONLY);
  if (fd < 0)
    return false;
  struct statx st;
  if (statx (fd, "", AT_EMPTY_PATH, STATX_SIZE, &st) != 0)
    {
      close (fd);
      return false;
    }
  void *ptr;
  if (st.stx_size == 0)
    ptr = NULL;
  else
    ptr = mmap (NULL, st.stx_size, PROT_READ, MAP_FILE | flags, fd, 0);
  close (fd);
  if (ptr == MAP_FAILED)
    return false;
  result->buffer = ptr;
  result->length = st.stx_size;
  return true;
}

static void
open_mmap_unmap (struct mapped *result)
{
  if (result->length > 0)
    {
      munmap (result->buffer, result->length);
      result->buffer = NULL;
      result->length = 0;
    }
}

int
main (int argc, char **argv)
{
  for (int i = 1; i < argc; ++i)
    {
      struct mapped mprivate = {NULL, 0};
      if (open_mmap (argv[i], MAP_PRIVATE, &mprivate))
        {
          void *p = mprivate.buffer;
          void *end = p + mprivate.length;
          while (p != end)
            {
              ssize_t count = write (STDOUT_FILENO, p, end - p);
              if (count == 0)
                {
                  errno = ENOSPC;
                  count = -1;
                }
              if (count < 0)
                err (1, "write");
              p += count;
            }
        }
      open_mmap_unmap (&mprivate);
    }
}

-- 
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to