ATLAS Offline Software
SealSharedLib.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
20 //<<<<<< INCLUDES >>>>>>
21 
22 #include "CxxUtils/SealCommon.h" // wlav
23 #include "CxxUtils/SealSharedLib.h" // wlav
24 #include "CxxUtils/SealDebug.h" // wlav
25 // wlav copied from SealBase/sysapi/SharedLibrary.h
26 # ifdef _WIN32
27 # include <windows.h>
28 # include <winnt.h>
29 # include <imagehlp.h>
30 # else
31 # if HAVE_DLOPEN
32 # include <dlfcn.h>
33 # elif HAVE_SHL_LOAD
34 # include <dl.h>
35 # elif HAVE_LOAD
36 # include "utils/dlfcn.h"
37 # endif
38 # if HAVE_LOADER_H
39 # include <loader.h>
40 # endif
41 # if HAVE_LINK_H
42 # include <link.h>
43 # include <limits.h>
44 # include <sys/stat.h>
45 # include <unistd.h>
46 # endif
47 # if HAVE_ELF_H
48 # include <elf.h>
49 # endif
50 # if HAVE_SGIDEFS_H // irix n32, 64
51 # include <sgidefs.h>
52 # include <objlist.h>
53 # include <obj_list.h>
54 # include <obj.h>
55 # endif
56 # if HAVE_MACH_O_DYLD_H // darwin
57 # include <mach-o/dyld.h>
58 # include <mach-o/getsect.h>
59 # endif
60 # endif // _WIN32
61 # include <cstring>
62 # include <cstdio>
63 # include <cstdlib>
64 # include <errno.h>
65 
66 #include <assert.h> // wlav
67 
68 #ifndef HAVE_R_DEBUG
69  extern ElfW(Dyn) _DYNAMIC []; // #pragma weak? // wlav
70 #endif
71 
72 //namespace seal { wlav
73 namespace Athena { // wlav
74 //<<<<<< PRIVATE DEFINES >>>>>>
75 
76 #ifndef SHLIB_UNSUPPORTED
77 # define SHLIB_UNSUPPORTED \
78  throw SharedLibraryError ("", "unsupported operation")
79 #endif
80 
81 
82 // wlav modified from SealBase/src/SharedLibraryError.cpp
83 SharedLibraryError::SharedLibraryError (const std::string& context,
84  const std::string& cause)
85  : m_message ("Shared library operation")
86 {
87  if (! context.empty ())
88  {
89  m_message += " ";
90  m_message += context;
91  }
92 
93  m_message += " failed";
94 
95  if (! cause.empty ())
96  {
97  m_message += " because: ";
98  m_message += cause;
99  }
100 }
101 
102 const char*
104 {
105  return m_message.c_str();
106 }
107 
108 
109 // wlav continued from SealBase/src/SharedLibrary.cpp
110 #ifdef _WIN32
111 static BOOL CALLBACK
112 enumModules (LPSTR name, ULONG base_address, PVOID context)
113 {
114  IMAGEHLP_MODULE moduleinfo;
116  = static_cast<SharedLibrary::InfoHandler *> (context);
117 
118  memset (&moduleinfo, 0, sizeof (moduleinfo));
119  moduleinfo.SizeOfStruct = sizeof (moduleinfo);
120 
122 
123  if (SymGetModuleInfo (GetCurrentProcess (), base_address, &moduleinfo))
124  {
125  info.m_filename = moduleinfo.LoadedImageName;
126  info.m_text_start = moduleinfo.BaseOfImage;
127  info.m_text_end = moduleinfo.BaseOfImage + moduleinfo.ImageSize;
128  info.m_data_start = 0;
129  info.m_data_end = 0;
130  info.m_bss_start = 0;
131  info.m_bss_end = 0;
132  }
133  else
134  {
135  info.m_filename = name;
136  info.m_text_start = base_address;
137  info.m_text_end = 0;
138  info.m_data_start = 0;
139  info.m_data_end = 0;
140  info.m_bss_start = 0;
141  info.m_bss_end = 0;
142  }
143  (*handler) (info);
144  return TRUE;
145 }
146 #endif
147 
148 //<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>>
149 //<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>>
150 
154 
155 std::string
157 {
158  const char *pathvar = PATH;
159  const char *path = pathvar ? getenv (pathvar) : 0;
160  return path ? path : "";
161 }
162 
163 void
165 {
166  /* Do not free `var'; most implementations of `putenv' use the
167  string without copying it. On systems where `putenv' copies,
168  you'll see leaks from this routine. It would be possible to
169  check for this, but only by killing cross-compilation.
170 
171  NB: `HAVE_COPYING_PUTENV' will never be set as we are not
172  checking for it :-) */
173 
174  const char *pathvar = PATH;
175  if (pathvar) {
176  const int path_size = strlen(pathvar) + 1 + path.length () + 1;
177  char *var = (char *) malloc (path_size);
178  snprintf (var, path_size, "%s=%s", pathvar, path.c_str ());
179  putenv (var);
180 #if HAVE_COPYING_PUTENV
181  free (var);
182 #endif
183  }
184 }
185 
191 std::string
192 SharedLibrary::libname (const std::string &name)
193 {
194 #ifdef _WIN32
195  return name + ".dll";
196 #elif defined __hpux
197  return "lib" + name + ".sl";
198 #else
199  return "lib" + name + ".so";
200 #endif
201 }
202 
209 std::string
210 SharedLibrary::symname (const std::string &name)
211 { return name; }
212 
214 
221 {
222 #if HAVE_DLOPEN || HAVE_LOAD
223  // NB: Linux (at least RH 7.x) dynamic loader is severely broken
224  // when it comes to reporting error messages. The error messages
225  // are frequently garbled or null. If you see a crash in a call
226  // to dlerror(), sorry, there's nothing we can do about that.
227  // Our attempts have only produced even more undesirable crashes.
228  // Waiting for a better version of the linux dynamic loader.
229  void *handle = ::dlopen (0, RTLD_LAZY);
230  if (! handle)
231  {
232  const char *msg = ::dlerror ();
233  msg = msg ? msg : "dynamic linker error message lost!";
234  throw SharedLibraryError ("dlopen()", msg);
235  }
236 
237  return new SharedLibrary (handle);
238 #elif HAVE_SHL_LOAD
239  return new SharedLibrary (PROG_HANDLE);
240 #elif defined _WIN32
241  return new SharedLibrary (::GetModuleHandle (0));
242 #else
244 #endif
245 }
246 
255 SharedLibrary::load (const std::string &name)
256 {
257  assert(! name.empty ());
258 
259  void *handle = 0;
260 
261 #if HAVE_DLOPEN || HAVE_LOAD
262 # ifndef RTLD_GLOBAL
263 # define RTLD_GLOBAL 0
264 # endif
265  // See comments in "self()" about crashes in dlerror().
266  if (! (handle = ::dlopen (name.c_str (), RTLD_LAZY | RTLD_GLOBAL)))
267  {
268  const char *msg = ::dlerror ();
269  msg = msg ? msg : "dynamic linker error message lost!";
270  throw SharedLibraryError ("dlopen()", msg);
271  }
272 
273 #elif HAVE_SHL_LOAD
274  if (! (handle = ::shl_load (name.c_str (), BIND_DEFERRED, 0L)))
275  throw SharedLibraryError ("shl_load()", errno);
276 
277 #elif defined _WIN32
278  if (! (handle = ::LoadLibrary (name.c_str ())))
279  throw SharedLibraryError ("LoadLibrary()", GetLastError ());
280 #else
282 #endif
283 
284  return new SharedLibrary (handle);
285 }
286 
289 void
291 {
292  // Dynamic linker characteristics:
293  // AIX, Windows, SVR4 (DG/UX, DRS/NX, DYNIX/ptx, Linux, SINIX,
294  // Solaris, UnixWare, {Free,Open,Net}BSD if __ELF__), BSD,
295  // HP-UX, IRIX, Tru64
296 
297  // Object file formats:
298  // XCOFF (AIX), ELF32/64 (DG/UX, DRS/NX, DYNIX/ptx, IRIX, SINIX,
299  // Solaris, UnixWare, {Free,Open,Net}BSD: if __ELF__), a.out
300  // ({Free,Open,Net}BSD if ! __ELF__, SunOS), BFD (Cygwin, HP-UX,
301  // Linux, LynxOS, Tru64, Windows if GCC), PE (Windows), COFF (?)
302 
303 #if HAVE_SHL_LOAD // hp-ux
304  shl_descriptor desc;
305 
306  for (int index = -1; shl_get_r (index, &desc) == 0; ++index)
307  {
309  info.m_filename = desc.filename;
310  info.m_text_start = desc.tstart;
311  info.m_text_end = desc.tend;
312  info.m_data_start = desc.dstart;
313  info.m_data_end = desc.dend;
314  info.m_bss_start = 0;
315  info.m_bss_end = 0;
316 
317  handler (info);
318  }
319 
320 #elif HAVE_LINK_H // bsd/svr4/elf
321 # if !HAVE_LINK_MAP_L_MAP_START
322 # define l_map_start l_addr
323 # define l_map_end l_addr
324 # endif
325 # if !HAVE_PROGRAM_INVOCATION_NAME
326  static const char *program_invocation_name = "(unknown program name)";
327 # endif
328 # if HAVE_R_DEBUG // linux/glibc
329  link_map *p = _r_debug.r_map;
330 # else
331  // Dynamic linker root:
332  // BSD (SunOS):
333  // #include <sys/types.h>
334  // #include <link.h>
335  // extern struct link_dynamic _DYNAMIC;
336  // link_dynamic *d = &_DYNAMIC;
337  // if ((d->ld_version > 1) && (d->ld_version <= 3) && (d->ld_un.ld_1 != 0))
338  // --> link_map *l = d->ld_un.ld_1->ld_loaded
339  // l->lm_name, l->lm_addr, l->lm_next
340  //
341  // BSD ({Free,Open,Net}BSD):
342  // #include <sys/types.h>
343  // #include <link.h>
344  // extern struct _dynamic _DYNAMIC
345  // _dynamic *d = &_DYNAMIC;
346  // if ((d->version == LD_VERSION_BSD) && d->d_un.d_sdt != 0))
347  // --> so_map *l = d->d_un.d_sdt->sdt_loaded
348  // l->som_path, l->som_addr, l->som_next
349  //
350  // SVR4 (DG/UX, DRS/NX, DYNIX/ptx, SINIX, UnixWare)
351  // ElfW(Dyn) _DYNAMIC[] // Linux
352  // void _DYNAMIC (void) // weak, really is data, but not
353  // // all compilers allow weak data
354  //
355  // Solaris:
356  // dlinfo (self, RTLD_DI_LINKMAP, &p);
357 
358  // extern ElfW(Dyn) _DYNAMIC []; // #pragma weak? // wlav
359  link_map *p = 0;
360  for (ElfW(Dyn) *dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
361  if (dyn->d_tag == DT_DEBUG && dyn->d_un.d_ptr)
362  // linux: p = ((r_debug *) dyn->d_un_d.ptr)->r_map;
363  p = (link_map *) *((unsigned long *) dyn->d_un.d_ptr + 1);
364 # endif
365 
366  if (! p)
367  throw SharedLibraryError ("loaded", "no shared library load map");
368 
369  // Get executable name; linux has a symlink in /proc/self/exe.
370  // Linux path names are arbitrarily long, so we just have create
371  // some random-sized buffer. We allocate this on stack to avoid
372  // dynamic memory allocation. If this is a problem, report a bug.
373  struct stat sbuf;
374  char exe [4096];
375 
376  memset (exe, 0, sizeof (exe));
377  if (::stat ("/proc/self/exe", &sbuf) == 0)
378  ::readlink ("/proc/self/exe", exe, sizeof (exe)-1);
379  else
380  STDC::strncpy (exe, program_invocation_name, sizeof (exe)-1);
381 
382  // Get shared libraries
383  for ( ; p; p = p->l_next)
384  {
386 
387  /* FIXME: Does this work with prelinked shared libraries?
388  From a mail to GCC mailing list ("fde-glibc.c bug"):
389 
390  There is a bug in gcc/config/ia64/fde-glibc.c:
391  ret = find_fde_for_dso ((Elf64_Addr)pc, (Elf64_Ehdr *)map->l_addr,
392  ^^^^^^^^^^^
393  segment_base, gp);
394 
395  this will work only as long as the shared library in
396  question has first PT_LOAD segment's p_vaddr == 0.
397  E.g. with ELF prelinking this is almost never true
398  though, so what you really want is map->l_map_start
399  (map->l_addr will be almost always 0) or even better
400  map->l_phdr/map->l_phnum pair. */
401 
402  // FIXME: use the map address (= ElfW(Ehdr)) to scan over
403  // the different ElfW(Phdr)s to find the various sections.
404  info.m_filename = (p->l_name && p->l_name[0] ? p->l_name : exe);
405  info.m_text_start = p->l_addr ? p->l_addr : p->l_map_start;
406  info.m_text_end = p->l_addr ? p->l_addr : p->l_map_end;
407  info.m_data_start = 0;
408  info.m_data_end = 0;
409  info.m_bss_start = 0;
410  info.m_bss_end = 0;
411 
412  handler (info);
413  }
414 
415 #elif HAVE_SGIDEFS_H // irix
416  /* From rld(1) man page:
417 
418  rld keeps a doubly linked list of structures and crt1.o
419  contains a pointer to the head of the list of obj structures
420  called __rld_obj_head. In an o32 executable, this points to a
421  linked list of objList structures (/usr/include/obj_list.h),
422  each of which has a `data' element which is a pointer to a
423  `struct obj' (/usr/include/obj.h) (even though the field is not
424  declared as a pointer). In an n32 executable, __rld_obj_head
425  points to a linked list of Elf32_Obj_Info structures
426  (/usr/include/objlist.h). In a 64-bit executable,
427  __rld_obj_head points to a linked list of Elf64_Obj_Info
428  structures (/usr/include/objlist.h). The `oi_magic' element of
429  each Elf32_Obj_Info or Elf64_Obj_Info is all-bits-on
430  (0xffffffff) to make it easier to determine which list type is
431  in use a 32-bit executable. */
432 
433  // To get more details by reading the ELF files:
434  // http://reality.sgi.com/davea/software.html
435  extern ElfW(Obj_Info) *__rld_obj_head;
436  ElfW(Obj_Info) *p = __rld_obj_head;
437 
438  for ( ; p; p = (ElfW(Obj_Info) *) p->oi_next)
439  {
441 
442 # if defined _MIPS_SIM_ABI32 && _MIPS_SIM == _MIPS_SIM_ABI32
443  info.m_filename = (const char *) p->o_path;
444  info.m_text_start = p->o_praw; // base address: o_base_address
445  info.m_text_end = p->o_praw;
446 # elif (defined _MIPS_SIM_NABI32 && _MIPS_SIM == _MIPS_SIM_NABI32) \
447  || (defined _MIPS_SIM_ABI64 && _MIPS_SIM == _MIPS_SIM_ABI64)
448  info.m_filename = (const char *) p->oi_pathname;
449  info.m_text_start = p->oi_ehdr; // base address: oi_orig_ehdr
450  info.m_text_end = p->oi_ehdr;
451 # else
452 # error "Unsupported ABI: not o32, n32 or 64"
453 # endif
454  info.m_data_start = 0;
455  info.m_data_end = 0;
456  info.m_bss_start = 0;
457  info.m_bss_end = 0;
458 
459  handler (info);
460  }
461 
462 #elif HAVE_LOADER_H && HAVE_LDR_NEXT_MODULE_DECL // tru64
463  ldr_process_t proc = ldr_my_process ();
464  ldr_module_t mod = LDR_NULL_MODULE;
465  int ret = ldr_next_module (proc, &mod);
466 
467  for (; ret == 0 && mod != LDR_NULL_MODULE; ret = ldr_next_module (proc, &mod))
468  {
469  ldr_module_info_t info;
470  size_t size = 0;
471  LibraryInfo libinfo;
472 
473  if (ldr_inq_module(proc, mod, &info, sizeof(info), &size) < 0)
474  throw SharedLibraryError ("ldr_inq_module()", errno);
475 
476  libinfo.m_filename = info.lmi_name;
477  libinfo.m_text_start = 0;
478  libinfo.m_text_end = 0;
479  libinfo.m_data_start = 0;
480  libinfo.m_data_end = 0;
481  libinfo.m_bss_start = 0;
482  libinfo.m_bss_end = 0;
483 
484  for (int i = 0; i < info.lmi_nregion; ++i)
485  {
486  ldr_region_info_t rinfo;
487  unsigned long low;
488  unsigned long high;
489 
490  if (ldr_inq_region(proc, mod, i, &rinfo, sizeof(rinfo), &size) < 0)
491  throw SharedLibraryError ("ldr_inq_region()", errno);
492 
493  low = (unsigned long) rinfo.lri_mapaddr;
494  high = ((unsigned long) rinfo.lri_mapaddr) + rinfo.lri_size;
495 
496  if (!strcmp(rinfo.lri_name, ".text")) {
497  libinfo.m_text_start = low;
498  libinfo.m_text_end = high;
499  } else if (!strcmp(rinfo.lri_name, ".data")) {
500  libinfo.m_data_start = low;
501  libinfo.m_data_end = high;
502  } else if (!strcmp(rinfo.lri_name, ".bss")) {
503  libinfo.m_bss_start = low;
504  libinfo.m_bss_end = high;
505  }
506  }
507 
508  handler (libinfo);
509  }
510 
511  if (ret < 0)
512  throw SharedLibraryError ("ldr_next_module()", errno);
513 
514 #elif HAVE_LOAD && HAVE_LOAD_DECL // aix
515  int size = 16;
516  void *buffer = new ld_info [size];
517  int error = ::loadquery (L_GETINFO, buffer, size);
518  int offset = 0;
519 
520  while (error == -1 && errno == ENOMEM)
521  {
522  delete [] (ld_info *) buffer;
523  buffer = new ld_info [size *= 2];
524  error = ::loadquery (L_GETINFO, buffer, size);
525  }
526 
527  if (error == -1)
528  throw SharedLibraryError ("loadquery()", errno);
529 
530  while (true)
531  {
533  ld_info *ld = (ld_info *) ((char *) buffer + offset);
534  const char *path = ld->ldinfo_filename;
535  const char *member = path + strlen (path) + 1;
536  std::string filename; // FIXME: Use alloca instead?
537 
538  filename = path;
539  if (*member)
540  {
541  filename += '(';
542  filename += member;
543  filename += ')';
544  }
545 
546  info.m_filename = filename.c_str ();
547  info.m_text_start = (unsigned long) ld->ldinfo_textorg;
548  info.m_text_end = info.m_text_start + ld->ldinfo_textsize;
549  info.m_data_start = (unsigned long) ld->ldinfo_dataorg;
550  info.m_data_end = info.m_data_start + ld->ldinfo_datasize;
551  info.m_bss_start = 0;
552  info.m_bss_end = 0;
553 
554  handler (info);
555 
556  if (ld->ldinfo_next)
557  offset += ld->ldinfo_next;
558  else
559  break;
560  }
561 
562  delete [] (ld_info *) buffer;
563 
564 #elif HAVE_MACH_O_DYLD_H // darwin
565  unsigned long images = _dyld_image_count ();
566  for (unsigned long i = 0; i < images; ++i)
567  {
568  const mach_header *hdr = _dyld_get_image_header (i);
569  unsigned long slide = _dyld_get_image_vmaddr_slide (i);
570  unsigned int size;
571  char *sect;
573 
574  info.m_filename = _dyld_get_image_name (i);
575 
576  sect = getsectdatafromheader (hdr, SEG_TEXT, SECT_TEXT, &size);
577  info.m_text_start = sect ? (unsigned long) sect + slide : 0;
578  info.m_text_end = sect ? (unsigned long) sect + slide + size : 0;
579  sect = getsectdatafromheader (hdr, SEG_DATA, SECT_DATA, &size);
580  info.m_data_start = sect ? (unsigned long) sect + slide : 0;
581  info.m_data_end = sect ? (unsigned long) sect + slide + size : 0;
582  sect = getsectdatafromheader (hdr, SEG_DATA, SECT_BSS, &size);
583  info.m_bss_start = sect ? (unsigned long) sect + slide : 0;
584  info.m_bss_end = sect ? (unsigned long) sect + slide + size : 0;
585 
586  handler (info);
587  }
588 
589 #elif defined _WIN32 // windows
590  if (! SymInitialize (GetCurrentProcess (), NULL, TRUE)
591  || ! SymEnumerateModules (GetCurrentProcess (), &enumModules, (void *) &handler)
592  || ! SymCleanup (GetCurrentProcess ()))
593  throw SharedLibraryError ("SymEnumerateModules()", GetLastError());
594 #else
596 #endif
597 }
598 
602  : m_handle (handle)
603 { assert (m_handle); }
604 
608 { assert (! m_handle); }
609 
615 void
617 {
618  assert (m_handle);
619 
620 #if HAVE_DLOPEN || HAVE_LOAD
621  ::dlclose (m_handle);
622 #elif HAVE_SHL_LOAD
623  ::shl_unload ((shl_t) m_handle);
624 #elif defined _WIN32
625  ::FreeLibrary ((HINSTANCE) m_handle);
626 #else
627  // cannot get here---`load' and `self' should take care of it.
628  assert (false);
629 #endif
630 
631  m_handle = 0;
632  delete this;
633 }
634 
638 void
640 {
641  assert (m_handle);
642  m_handle = 0;
643  delete this;
644 }
645 
654 SharedLibrary::data (const std::string &name, bool mangle /* = true */) const
655 {
656  assert (! name.empty ());
657  assert (m_handle);
658  std::string mangled = mangle ? symname (name) : name;
659  Data symbol = 0;
660 
661 #if HAVE_DLOPEN || HAVE_LOAD
662  // See comments in "self()" about crashes in dlerror().
663  const char *error = 0;
664  symbol = ::dlsym (m_handle, mangled.c_str ());
665  if (! symbol && (error = ::dlerror ()) != 0)
666  throw SharedLibraryError ("dlsym()", error);
667 
668 #elif HAVE_SHL_LOAD
669  shl_t handle = (shl_t) m_handle;
670  if (::shl_findsym (&handle, mangled.c_str (), TYPE_DATA, &symbol) != 0)
671  throw SharedLibraryError ("shl_findsym()", errno);
672  assert (handle == (shl_t) m_handle);
673 
674 #elif defined _WIN32
675  if (! (symbol = (Data)::GetProcAddress((HINSTANCE)m_handle, mangled.c_str())))
676  throw SharedLibraryError ("GetProcAddress()", GetLastError ());
677 #else
678  // cannot get here---`load' and `self' should take care of it.
679  assert (false);
680 #endif
681  return symbol;
682 }
683 
692 SharedLibrary::function (const std::string &name, bool mangle /* = true */) const
693 {
694  assert (! name.empty ());
695  assert (m_handle);
696  std::string mangled = mangle ? symname (name) : name;
697  Function symbol = 0;
698 
699 #if HAVE_DLOPEN || HAVE_LOAD
700  // See comments in "self()" about crashes in dlerror().
701  const char *error = 0;
702  union { Function func; Data data; } sym;
703  sym.data = ::dlsym (m_handle, mangled.c_str ());
704  if (! sym.data && (error = ::dlerror ()) != 0)
705  throw SharedLibraryError ("dlsym()", error);
706  symbol = sym.func;
707 
708 #elif HAVE_SHL_LOAD
709  shl_t handle = (shl_t) m_handle;
710  if (::shl_findsym (&handle, mangled.c_str (), TYPE_PROCEDURE, &symbol) != 0)
711  throw SharedLibraryError ("shl_findsym()", errno);
712  assert (handle == (shl_t) m_handle);
713 
714 #elif defined _WIN32
715  if (! (symbol = (Function) ::GetProcAddress ((HINSTANCE) m_handle,
716  mangled.c_str ())))
717  throw SharedLibraryError ("GetProcAddress()", GetLastError ());
718 #else
719  // cannot get here---`load' and `self' should take care of it.
720  assert (false);
721 #endif
722  return symbol;
723 }
724 
725 //} // namespace seal wlav
726 } // namespace Athena wlav
727 
grepfile.info
info
Definition: grepfile.py:38
Athena::SharedLibrary::LibraryInfo::m_data_start
unsigned long m_data_start
Definition: SealSharedLib.h:168
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
Athena::SharedLibrary::Data
void * Data
Definition: SealSharedLib.h:160
Athena::SharedLibrary::LibraryInfo::m_text_start
unsigned long m_text_start
Definition: SealSharedLib.h:166
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
Athena::SharedLibrary::data
Data data(const std::string &name, bool mangle=true) const
Locate and return a reference to a data symbol called name.
Definition: SealSharedLib.cxx:654
index
Definition: index.py:1
SealDebug.h
This are the SEAL debug aids, adapted to build in Atlas, after the drop of that project.
Athena::SharedLibrary::SharedLibrary
SharedLibrary(void *handle)
Protected constructor for initialising a library object.
Definition: SealSharedLib.cxx:601
SealCommon.h
Collecting a few shared bits and pieces from SEAL headers.
SHLIB_UNSUPPORTED
#define SHLIB_UNSUPPORTED
Definition: SealSharedLib.cxx:77
Athena::SharedLibrary::LibraryInfo::m_data_end
unsigned long m_data_end
Definition: SealSharedLib.h:169
Athena::SharedLibraryError
Error in a shared library operation.
Definition: SealSharedLib.h:144
Athena::SharedLibrary::LibraryInfo::m_bss_end
unsigned long m_bss_end
Definition: SealSharedLib.h:171
handler
void handler(int sig)
signal handler
Definition: rmain.cxx:98
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Athena::SharedLibraryError::m_message
std::string m_message
Definition: SealSharedLib.h:152
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
SealSharedLib.h
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
Athena::SharedLibrary::path
static std::string path(void)
Definition: SealSharedLib.cxx:156
lumiFormat.i
int i
Definition: lumiFormat.py:92
Athena::SharedLibrary::LibraryInfo::m_bss_start
unsigned long m_bss_start
Definition: SealSharedLib.h:170
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
ret
T ret(T t)
Definition: rootspy.cxx:260
Athena::SharedLibrary::load
static SharedLibrary * load(const std::string &name)
Load a shared library and return an object representing it.
Definition: SealSharedLib.cxx:255
Athena::SharedLibrary::Function
void(* Function)(void)
Definition: SealSharedLib.h:161
Athena::SharedLibrary::LibraryInfo::m_filename
const char * m_filename
Definition: SealSharedLib.h:172
python.Constants.TRUE
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
Definition: Control/AthenaCommon/python/Constants.py:22
TrigInDetValidation_Base.malloc
malloc
Definition: TrigInDetValidation_Base.py:129
Athena::SharedLibrary::LibraryInfo::m_text_end
unsigned long m_text_end
Definition: SealSharedLib.h:167
beamspotman.stat
stat
Definition: beamspotman.py:266
Athena::SharedLibrary::~SharedLibrary
~SharedLibrary(void)
Protected destructor for cleaning up a library object.
Definition: SealSharedLib.cxx:607
Athena::SharedLibrary::release
void release(void)
Release a shared library.
Definition: SealSharedLib.cxx:616
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Athena::SharedLibrary::symname
static std::string symname(const std::string &name)
Transform 'extern "C"' symbol name into a name suitable for lookup in a shared library,...
Definition: SealSharedLib.cxx:210
Athena::SharedLibraryError::what
virtual const char * what() const
Definition: SealSharedLib.cxx:103
Athena::SharedLibrary::LibraryInfo
Information about a currently loaded shared library.
Definition: SealSharedLib.h:165
Athena::SharedLibrary::abandon
void abandon(void)
Abandon a library.
Definition: SealSharedLib.cxx:639
Athena::SharedLibrary
Shared library services.
Definition: SealSharedLib.h:158
ElfW
ElfW(Dyn) _DYNAMIC[]
Athena::Callback1
Definition: SealSharedLib.h:51
Athena::SharedLibrary::libname
static std::string libname(const std::string &name)
Return a shared library name that follows the system conventions for naming shared library.
Definition: SealSharedLib.cxx:192
Athena::SharedLibrary::m_handle
void * m_handle
Definition: SealSharedLib.h:197
DeMoScan.index
string index
Definition: DeMoScan.py:362
windows.h
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
PATH
TString PATH
Definition: run_EoverP.cxx:91
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
Athena::SharedLibrary::loaded
static void loaded(InfoHandler &handler)
Iterate and provide information about all currently loaded shared libraries.
Definition: SealSharedLib.cxx:290
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
Athena::SharedLibraryError::SharedLibraryError
SharedLibraryError(const std::string &context, const std::string &cause)
Definition: SealSharedLib.cxx:83
Athena::SharedLibrary::self
static SharedLibrary * self(void)
Return a shared library object representing the application itself.
Definition: SealSharedLib.cxx:220
error
Definition: IImpactPoint3dEstimator.h:70
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:14
Athena::SharedLibrary::function
Function function(const std::string &name, bool mangle=true) const
Locate and return a reference to a function symbol called name.
Definition: SealSharedLib.cxx:692
Athena::ATLAS_NOT_THREAD_SAFE
void DebugAids::stacktraceLine ATLAS_NOT_THREAD_SAFE(IOFD fd, unsigned long addr)
Write out stack trace line to FD.
Definition: SealDebug.cxx:328