Blame elf/tst-tls-ie-mod.h

Packit Service a2413a
/* Module with specified TLS size and model.
Packit Service a2413a
   Copyright (C) 2020 Free Software Foundation, Inc.
Packit Service a2413a
   This file is part of the GNU C Library.
Packit Service a2413a
Packit Service a2413a
   The GNU C Library is free software; you can redistribute it and/or
Packit Service a2413a
   modify it under the terms of the GNU Lesser General Public
Packit Service a2413a
   License as published by the Free Software Foundation; either
Packit Service a2413a
   version 2.1 of the License, or (at your option) any later version.
Packit Service a2413a
Packit Service a2413a
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service a2413a
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2413a
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service a2413a
   Lesser General Public License for more details.
Packit Service a2413a
Packit Service a2413a
   You should have received a copy of the GNU Lesser General Public
Packit Service a2413a
   License along with the GNU C Library; if not, see
Packit Service a2413a
   <https://www.gnu.org/licenses/>.  */
Packit Service a2413a
Packit Service a2413a
/* This file is parameterized by macros N, SIZE and MODEL.  */
Packit Service a2413a
Packit Service a2413a
#include <stdio.h>
Packit Service a2413a
#include <string.h>
Packit Service a2413a
Packit Service a2413a
#define CONCATX(x, y) x ## y
Packit Service a2413a
#define CONCAT(x, y) CONCATX (x, y)
Packit Service a2413a
#define STRX(x) #x
Packit Service a2413a
#define STR(x) STRX (x)
Packit Service a2413a
Packit Service a2413a
#define VAR CONCAT (var, N)
Packit Service a2413a
Packit Service a2413a
__attribute__ ((aligned (8), tls_model (MODEL)))
Packit Service a2413a
__thread char VAR[SIZE];
Packit Service a2413a
Packit Service a2413a
void
Packit Service a2413a
CONCAT (access, N) (void)
Packit Service a2413a
{
Packit Service a2413a
  printf (STR (VAR) "[%d]:\t %p .. %p " MODEL "\n", SIZE, VAR, VAR + SIZE);
Packit Service a2413a
  fflush (stdout);
Packit Service a2413a
  memset (VAR, 1, SIZE);
Packit Service a2413a
}