* alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate.
* i386_retval.c: Likewise.
* ia64_retval.c: Likewise.
* ppc64_retval.c: Likewise.
* ppc_retval.c: Likewise.
* s390_retval.c: Likewise.
* sparc_retval.c: Likewise.
* x86_64_retval.c: Likewise.
+Version 0.130:
+
+readelf: -p option can take an argument like -x for one section,
+ or no argument (as before) for all SHF_STRINGS sections
+
Version 0.129:
readelf: new options --hex-dump (or -x), --strings (or -p)
+2007-09-27 Roland McGrath <roland@redhat.com>
+
+ * alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate.
+ * i386_retval.c: Likewise.
+ * ia64_retval.c: Likewise.
+ * ppc64_retval.c: Likewise.
+ * ppc_retval.c: Likewise.
+ * s390_retval.c: Likewise.
+ * sparc_retval.c: Likewise.
+ * x86_64_retval.c: Likewise.
+
2007-08-23 Roland McGrath <roland@redhat.com>
* x86_64_regs.c (x86_64_register_info): Put %rflags in "integer" set.
/* Function return value location for Alpha ELF ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_ptr_to_member_type:
{
Dwarf_Word size;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
*locp = loc_fpreg;
/* Function return value location for Linux/i386 ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_ptr_to_member_type:
{
Dwarf_Word size;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 4;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
/* Function return value location for IA64 ABI.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
return -1;
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem), &encoding) != 0)
return -1;
switch (encoding)
case DW_TAG_member:;
Dwarf_Die child_type_mem;
Dwarf_Die *child_typedie
- = dwarf_formref_die (dwarf_attr (&child_mem, DW_AT_type,
- &attr_mem),
+ = dwarf_formref_die (dwarf_attr_integrate (&child_mem,
+ DW_AT_type,
+ &attr_mem),
&child_type_mem);
if (tag == DW_TAG_union_type)
{
break;
Dwarf_Die base_type_mem;
- Dwarf_Die *base_typedie = dwarf_formref_die (dwarf_attr (typedie,
- DW_AT_type,
- &attr_mem),
- &base_type_mem);
+ Dwarf_Die *base_typedie
+ = dwarf_formref_die (dwarf_attr_integrate (typedie, DW_AT_type,
+ &attr_mem),
+ &base_type_mem);
int used = hfa_type (base_typedie, locp, 0);
if (used < 0 || used > 8)
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
switch (encoding)
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
return -1;
/* If this qualifies as an homogeneous floating-point aggregate
/* Function return value location for Linux/PPC64 ABI.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float || encoding == DW_ATE_complex_float)
case DW_TAG_string_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size <= 8)
{
if (tag == DW_TAG_array_type)
{
/* Check if it's a character array. */
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
if (tag != DW_TAG_base_type)
goto aggregate;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie,
+ DW_AT_byte_size,
+ &attr_mem),
+ &size) != 0)
return -1;
if (size != 1)
goto aggregate;
/* Function return value location for Linux/PPC ABI.
- Copyright (C) 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 4;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie,
+ DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
case DW_TAG_union_type:
case DW_TAG_array_type:
if (SVR4_STRUCT_RETURN
- && dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ && dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size > 0 && size <= 8)
goto intreg;
goto aggregate;
/* Function return value location for S/390 ABI.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float && size <= 8)
{
/* Function return value location for SPARC.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2007 Red Hat, Inc.
This program is Open Source software; you can redistribute it and/or
modify it under the terms of the Open Software License version 1.0 as
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
uint8_t asize;
Dwarf_Die cudie;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
if (encoding == DW_ATE_float)
{
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) == 0
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) == 0
&& size > 0 && size <= 8)
goto intreg;
goto aggregate;
/* Function return value location for Linux/x86-64 ABI.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
which is the type of the return value. */
Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem);
+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
+ &attr_mem);
if (attr == NULL)
/* The function has no return value, like a `void' function in C. */
return 0;
|| tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
|| tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
return -1;
case DW_TAG_subrange_type:
- if (! dwarf_hasattr (typedie, DW_AT_byte_size))
+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
{
- attr = dwarf_attr (typedie, DW_AT_type, &attr_mem);
+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
typedie = dwarf_formref_die (attr, &die_mem);
tag = dwarf_tag (typedie);
}
case DW_TAG_enumeration_type:
case DW_TAG_pointer_type:
case DW_TAG_ptr_to_member_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
{
if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
size = 8;
if (tag == DW_TAG_base_type)
{
Dwarf_Word encoding;
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding,
- &attr_mem), &encoding) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
+ &attr_mem),
+ &encoding) != 0)
return -1;
switch (encoding)
case DW_TAG_class_type:
case DW_TAG_union_type:
case DW_TAG_array_type:
- if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size,
- &attr_mem), &size) != 0)
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
return -1;
if (size > 16)
goto large;
+2007-09-11 Roland McGrath <roland@redhat.com>
+
+ * dwfl_module_addrsym.c: Prefer a later global symbol at the same
+ address if its st_size is smaller.
+
2007-08-13 Roland McGrath <roland@redhat.com>
* dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
and is closer to ADDR or is global when it was local. */
if (name[0] != '\0'
&& GELF_ST_TYPE (sym.st_info) != STT_SECTION
- && GELF_ST_TYPE (sym.st_info) != STT_FILE
- && (closest_name == NULL
+ && GELF_ST_TYPE (sym.st_info) != STT_FILE)
+ {
+ if (closest_name == NULL
|| closest_sym->st_value < sym.st_value
|| (GELF_ST_BIND (closest_sym->st_info)
- < GELF_ST_BIND (sym.st_info))))
- {
- if (sym.st_size != 0)
+ < GELF_ST_BIND (sym.st_info)))
+ {
+ if (sym.st_size != 0)
+ {
+ *closest_sym = sym;
+ closest_shndx = shndx;
+ closest_name = name;
+ }
+ else if (same_section (&sym, shndx))
+ {
+ /* Handwritten assembly symbols sometimes have no
+ st_size. If no symbol with proper size includes
+ the address, we'll use the closest one that is in
+ the same section as ADDR. */
+ sizeless_sym = sym;
+ sizeless_shndx = shndx;
+ sizeless_name = name;
+ }
+ }
+ /* When the beginning of its range is no closer,
+ the end of its range might be. */
+ else if (sym.st_size != 0
+ && closest_sym->st_value == sym.st_value
+ && closest_sym->st_size > sym.st_size)
{
*closest_sym = sym;
closest_shndx = shndx;
closest_name = name;
}
- else if (same_section (&sym, shndx))
- {
- /* Handwritten assembly symbols sometimes have no st_size.
- If no symbol with proper size includes the address,
- we'll use the closest one that is in the same section
- as ADDR. */
- sizeless_sym = sym;
- sizeless_shndx = shndx;
- sizeless_name = name;
- }
}
}
}
+2007-08-24 Roland McGrath <roland@redhat.com>
+
+ * gelf_getnote.c: New file.
+ * Makefile.am (libelf_a_SOURCES): Add it.
+ * gelf.h: Declare gelf_getnote.
+ * libelf.map (ELFUTILS_1.3): Add gelf_getnote.
+
+ * libelfP.h (NOTE_ALIGN): New macro.
+ * note_xlate.h: New file.
+ * Makefile.am (noinst_HEADERS): Add it.
+ * gelf_xlate.c: Include it.
+ (__elf_xfctstom): Use elf_cvt_note.
+ * elf_getdata.c (shtype_map, __libelf_type_align): Handle SHT_NOTE.
+ (__libelf_set_rawdata): Likewise.
+
2007-08-19 Roland McGrath <roland@redhat.com>
* gelf_update_auxv.c: New file.
gelf_getmove.c gelf_update_move.c \
gelf_getsyminfo.c gelf_update_syminfo.c \
gelf_getauxv.c gelf_update_auxv.c \
+ gelf_getnote.c \
gelf_xlatetof.c gelf_xlatetom.c \
nlist.c \
gelf_getsymshndx.c gelf_update_symshndx.c \
endif
noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
- version_xlate.h gnuhash_xlate.h dl-hash.h
+ version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
EXTRA_DIST = libelf.map
CLEANFILES = $(am_libelf_pic_a_OBJECTS) *.gcno *.gcda libelf.so.$(VERSION)
[SHT_PREINIT_ARRAY] = ELF_T_ADDR,
[SHT_GROUP] = ELF_T_WORD,
[SHT_SYMTAB_SHNDX] = ELF_T_WORD,
+ [SHT_NOTE] = ELF_T_NHDR,
[TYPEIDX (SHT_GNU_verdef)] = ELF_T_VDEF,
[TYPEIDX (SHT_GNU_verneed)] = ELF_T_VNEED,
[TYPEIDX (SHT_GNU_versym)] = ELF_T_HALF,
[ELF_T_VNAUX] = __alignof__ (ElfW2(Bits,Vernaux)), \
[ELF_T_MOVE] = __alignof__ (ElfW2(Bits,Move)), \
[ELF_T_LIB] = __alignof__ (ElfW2(Bits,Lib)), \
+ [ELF_T_NHDR] = __alignof__ (ElfW2(Bits,Nhdr)), \
}
[EV_CURRENT - 1] =
{
else
{
Elf_Type t = shtype_map[LIBELF_EV_IDX][TYPEIDX (type)];
- if (t == ELF_T_VDEF
+ if (t == ELF_T_VDEF || t == ELF_T_NHDR
|| (t == ELF_T_GNUHASH && elf->class == ELFCLASS64))
entsize = 1;
else
extern int gelf_update_auxv (Elf_Data *__data, int __ndx, GElf_auxv_t *__src);
+/* Get note header at the given offset into the data, and the offsets of
+ the note's name and descriptor data. Returns the offset of the next
+ note header, or 0 for an invalid offset or corrupt note header. */
+extern size_t gelf_getnote (Elf_Data *__data, size_t __offset,
+ GElf_Nhdr *__result,
+ size_t *__name_offset, size_t *__desc_offset);
+
+
/* Retrieve uninterpreted chunk of the file contents. */
extern char *gelf_rawchunk (Elf *__elf, GElf_Off __offset, GElf_Word __size);
--- /dev/null
+/* Get note information at the supplied offset.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <gelf.h>
+#include <string.h>
+
+#include "libelfP.h"
+
+size_t
+gelf_getnote (data, offset, result, name_offset, desc_offset)
+ Elf_Data *data;
+ size_t offset;
+ GElf_Nhdr *result;
+ size_t *name_offset;
+ size_t *desc_offset;
+{
+ if (data == NULL)
+ return 0;
+
+ if (unlikely (data->d_type != ELF_T_NHDR))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+ return 0;
+ }
+
+ /* It's easy to handle this type. It has the same size for 32 and
+ 64 bit objects. */
+ assert (sizeof (GElf_Nhdr) == sizeof (Elf32_Nhdr));
+ assert (sizeof (GElf_Nhdr) == sizeof (Elf64_Nhdr));
+
+ rwlock_rdlock (((Elf_Data_Scn *) data)->s->elf->lock);
+
+ /* The data is already in the correct form. Just make sure the
+ offset is OK. */
+ if (unlikely (offset + sizeof (GElf_Nhdr) > data->d_size))
+ {
+ __libelf_seterrno (ELF_E_OFFSET_RANGE);
+ offset = 0;
+ }
+ else
+ {
+ const GElf_Nhdr *n = data->d_buf + offset;
+ offset += sizeof *n;
+
+ GElf_Word namesz = NOTE_ALIGN (n->n_namesz);
+ GElf_Word descsz = NOTE_ALIGN (n->n_descsz);
+
+ if (unlikely (data->d_size - offset < namesz))
+ offset = 0;
+ else
+ {
+ *name_offset = offset;
+ offset += namesz;
+ if (unlikely (data->d_size - offset < descsz))
+ offset = 0;
+ else
+ {
+ *desc_offset = offset;
+ offset += descsz;
+ *result = *n;
+ }
+ }
+ }
+
+ rwlock_unlock (((Elf_Data_Scn *) data)->s->elf->lock);
+
+ return offset;
+}
do not contain records of only one type. */
#include "version_xlate.h"
#include "gnuhash_xlate.h"
+#include "note_xlate.h"
/* Now the externally visible table with the function pointers. */
[ELF_T_VDAUX] = elf_cvt_Verdef, \
[ELF_T_VNEED] = elf_cvt_Verneed, \
[ELF_T_VNAUX] = elf_cvt_Verneed, \
- [ELF_T_NHDR] = ElfW2(Bits, cvt_Nhdr), \
+ [ELF_T_NHDR] = elf_cvt_note, \
[ELF_T_SYMINFO] = ElfW2(Bits, cvt_Syminfo), \
[ELF_T_MOVE] = ElfW2(Bits, cvt_Move), \
[ELF_T_LIB] = ElfW2(Bits, cvt_Lib), \
global:
gelf_getauxv;
gelf_update_auxv;
+ gelf_getnote;
};
} \
} while (0)
+/* Align offset to 4 bytes as needed for note name and descriptor data. */
+#define NOTE_ALIGN(n) (((n) + 3) & -4U)
+
#endif /* libelfP.h */
--- /dev/null
+/* Conversion functions for notes.
+ Copyright (C) 2007 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+static void
+elf_cvt_note (void *dest, const void *src, size_t len, int encode)
+{
+ assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
+
+ while (len > 0)
+ {
+ (1 ? Elf32_cvt_Nhdr : Elf64_cvt_Nhdr) (dest, src, sizeof (Elf32_Nhdr),
+ encode);
+ const Elf32_Nhdr *n = encode ? src : dest;
+ Elf32_Word namesz = NOTE_ALIGN (n->n_namesz);
+ Elf32_Word descsz = NOTE_ALIGN (n->n_descsz);
+
+ len -= sizeof *n;
+ src += sizeof *n;
+ dest += sizeof *n;
+
+ if (namesz > len)
+ break;
+ len -= namesz;
+ if (descsz > len)
+ break;
+ len -= descsz;
+
+ if (src != dest)
+ memcpy (dest, src, namesz + descsz);
+
+ src += namesz + descsz;
+ dest += namesz + descsz;
+ }
+}
+2007-09-10 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (options): Give -p optional argument, alias --string-dump.
+ (string_sections, string_sections_tail): New static variables.
+ (parse_opt): Set them when -p has an argument.
+ (print_string_section): New function, broken out of ...
+ (print_strings): ... here. Call it.
+ (dump_data_section): New function, broken out of ...
+ (dump_data): ... here. Call it.
+ (for_each_section_argument): New function, broken out of ...
+ (dump_data): ... here. Call it.
+ (dump_strings): New function.
+
+2007-08-31 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_strings): Typo fix.
+
2007-08-23 Roland McGrath <roland@redhat.com>
* readelf.c (printf_with_wrap): Function removed.
N_("Display architecture specific information (if any)"), 0 },
{ "hex-dump", 'x', "SECTION", 0,
N_("Dump the uninterpreted contents of SECTION, by number or name"), 0 },
- { "strings", 'p', NULL, 0,
- N_("Print contents of sections marked as containing only strings"), 0 },
+ { "strings", 'p', "SECTION", OPTION_ARG_OPTIONAL,
+ N_("Print string contents of sections"), 0 },
+ { "string-dump", 'p', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 },
{ NULL, 0, NULL, 0, N_("Output control:"), 0 },
static struct section_argument *dump_data_sections;
static struct section_argument **dump_data_sections_tail = &dump_data_sections;
+/* Select string dumping of sections. */
+static struct section_argument *string_sections;
+static struct section_argument **string_sections_tail = &string_sections;
+
struct section_argument
{
struct section_argument *next;
static void handle_notes (Ebl *ebl, GElf_Ehdr *ehdr);
static void print_liblist (Ebl *ebl);
static void dump_data (Ebl *ebl);
+static void dump_strings (Ebl *ebl);
static void print_strings (Ebl *ebl);
print_symbol_table = true;
any_control_option = true;
break;
- case 'p':
- print_string_sections = true;
- any_control_option = true;
- break;
case 'V':
print_version_info = true;
any_control_option = true;
}
any_control_option = true;
break;
+ case 'p':
+ any_control_option = true;
+ if (arg == NULL)
+ {
+ print_string_sections = true;
+ break;
+ }
+ /* Fall through. */
case 'x':
{
struct section_argument *a = xmalloc (sizeof *a);
a->arg = arg;
a->next = NULL;
- *dump_data_sections_tail = a;
- dump_data_sections_tail = &a->next;
+ struct section_argument ***tailp
+ = key == 'x' ? &dump_data_sections_tail : &string_sections_tail;
+ **tailp = a;
+ *tailp = &a->next;
}
any_control_option = true;
break;
print_liblist (ebl);
if (dump_data_sections != NULL)
dump_data (ebl);
+ if (string_sections != NULL)
+ dump_strings (ebl);
if (print_debug_sections != 0)
print_debug (ebl, ehdr);
if (print_notes)
}
static void
-dump_data (Ebl *ebl)
+dump_data_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
+{
+ if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
+ printf (gettext ("\nSection [%Zu] '%s' has no data to dump.\n"),
+ elf_ndxscn (scn), name);
+ else
+ {
+ Elf_Data *data = elf_rawdata (scn, NULL);
+ if (data == NULL)
+ error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+ elf_ndxscn (scn), name, elf_errmsg (-1));
+ else
+ {
+ printf (gettext ("\nHex dump of section [%Zu] '%s', %" PRIu64
+ " bytes at offset %#0" PRIx64 ":\n"),
+ elf_ndxscn (scn), name,
+ shdr->sh_size, shdr->sh_offset);
+ hex_dump (data->d_buf, data->d_size);
+ }
+ }
+}
+
+static void
+print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
+{
+ if (shdr->sh_size == 0)
+ printf (gettext ("\nSection [%Zu] '%s' is empty.\n"),
+ elf_ndxscn (scn), name);
+
+ Elf_Data *data = elf_rawdata (scn, NULL);
+ if (data == NULL)
+ error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+ elf_ndxscn (scn), name, elf_errmsg (-1));
+ else
+ {
+ printf (gettext ("\nString section [%Zu] '%s' contains %" PRIu64
+ " bytes at offset %#0" PRIx64 ":\n"),
+ elf_ndxscn (scn), name,
+ shdr->sh_size, shdr->sh_offset);
+
+ const char *start = data->d_buf;
+ const char *const limit = start + data->d_size;
+ do
+ {
+ const char *end = memchr (start, '\0', limit - start);
+ const size_t pos = start - (const char *) data->d_buf;
+ if (unlikely (end == NULL))
+ {
+ printf (" [%6Zx]- %.*s\n",
+ pos, (int) (limit - start), start);
+ break;
+ }
+ printf (" [%6Zx] %s\n", pos, start);
+ start = end + 1;
+ } while (start < limit);
+ }
+}
+
+static void
+for_each_section_argument (Elf *elf, const struct section_argument *list,
+ void (*dump) (Elf_Scn *scn, const GElf_Shdr *shdr,
+ const char *name))
{
/* Get the section header string table index. */
size_t shstrndx;
- if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
+ if (elf_getshstrndx (elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
- for (struct section_argument *a = dump_data_sections; a != NULL; a = a->next)
+ for (const struct section_argument *a = list; a != NULL; a = a->next)
{
Elf_Scn *scn;
GElf_Shdr shdr_mem;
unsigned long int shndx = strtoul (a->arg, &endp, 0);
if (endp != a->arg && *endp == '\0')
{
- scn = elf_getscn (ebl->elf, shndx);
+ scn = elf_getscn (elf, shndx);
if (scn == NULL)
{
error (0, 0, gettext ("\nsection [%lu] does not exist"), shndx);
if (gelf_getshdr (scn, &shdr_mem) == NULL)
error (EXIT_FAILURE, 0, gettext ("cannot get section header: %s"),
elf_errmsg (-1));
- name = elf_strptr (ebl->elf, shstrndx, shdr_mem.sh_name);
+ name = elf_strptr (elf, shstrndx, shdr_mem.sh_name);
}
else
{
/* Need to look up the section by name. */
scn = NULL;
- while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
{
if (gelf_getshdr (scn, &shdr_mem) == NULL)
continue;
- name = elf_strptr (ebl->elf, shstrndx, shdr_mem.sh_name);
+ name = elf_strptr (elf, shstrndx, shdr_mem.sh_name);
if (name == NULL)
continue;
if (!strcmp (name, a->arg))
}
}
- if (shdr_mem.sh_size == 0 || shdr_mem.sh_type == SHT_NOBITS)
- printf (gettext ("\nSection [%Zu] '%s' has no data to dump.\n"),
- elf_ndxscn (scn), name);
- else
- {
- Elf_Data *data = elf_rawdata (scn, NULL);
- if (data == NULL)
- error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
- elf_ndxscn (scn), name, elf_errmsg (-1));
- else
- {
- printf (gettext ("\nHex dump of section [%Zu] '%s', %" PRIu64
- " bytes at offset %#0" PRIx64 ":\n"),
- elf_ndxscn (scn), name,
- shdr_mem.sh_size, shdr_mem.sh_offset);
- hex_dump (data->d_buf, data->d_size);
- }
- }
+ (*dump) (scn, &shdr_mem, name);
}
}
+static void
+dump_data (Ebl *ebl)
+{
+ for_each_section_argument (ebl->elf, dump_data_sections, &dump_data_section);
+}
+
+static void
+dump_strings (Ebl *ebl)
+{
+ for_each_section_argument (ebl->elf, string_sections, &print_string_section);
+}
+
static void
print_strings (Ebl *ebl)
{
if (name == NULL)
continue;
- if (shdr_mem.sh_size == 0)
- printf (gettext ("\nSection [%Zu] '%s' is empty.\n"),
- elf_ndxscn (scn), name);
-
- Elf_Data *data = elf_rawdata (scn, NULL);
- if (data == NULL)
- error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
- elf_ndxscn (scn), name, elf_errmsg (-1));
- else
- {
- printf (gettext ("\nString section [%Zu] '%s' contains %" PRIu64
- " bytes at offset %#0" PRIx64 ":\n"),
- elf_ndxscn (scn), name,
- shdr_mem.sh_size, shdr_mem.sh_offset);
-
- const char *start = data->d_buf;
- const char *const limit = start + data->d_size;
- do
- {
- const char *end = memchr (start, '\0', limit - start);
- const size_t pos = start - (const char *) data->d_buf;
- if (unlikely (end == NULL))
- {
- printf (" [%6Zx]- %.*s\n", pos, (int) (end - start), start);
- break;
- }
- printf (" [%6Zx] %s\n", pos, start);
- start = end + 1;
- } while (start < limit);
- }
+ print_string_section (scn, &shdr_mem, name);
}
}
+2007-09-11 Roland McGrath <roland@redhat.com>
+
+ * run-addrname-test.sh: Add a new case.
+ * testfile41.bz2: New data file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2007-08-23 Roland McGrath <roland@redhat.com>
* run-allregs.sh: Update expected x86-64 output for %rflags.
testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
testfile36.bz2 testfile36.debug.bz2 \
testfile37.bz2 testfile37.debug.bz2 \
- testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2
+ testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
+ testfile41.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
. $srcdir/test-subr.sh
-testfiles testfile34 testfile38
+testfiles testfile34 testfile38 testfile41
testrun_compare ../src/addr2line -f -e testfile34 \
0x08048074 0x08048075 0x08048076 \
??:0
EOF
+testrun_compare ../src/addr2line -S -e testfile41 0x1 0x104 <<\EOF
+small_global_at_large_global+0x1
+??:0
+small_global_first_at_large_global+0x1
+??:0
+EOF
+
exit 0