}
}
+static void
+decode_1_needed (unsigned int bitmask)
+{
+ while (bitmask)
+ {
+ unsigned int bit = bitmask & (- bitmask);
+
+ bitmask &= ~ bit;
+ switch (bit)
+ {
+ case GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS:
+ printf ("indirect external access");
+ break;
+ default:
+ printf (_("<unknown: %x>"), bit);
+ break;
+ }
+ if (bitmask)
+ printf (", ");
+ }
+}
+
static void
print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote)
{
|| (type >= GNU_PROPERTY_UINT32_OR_LO
&& type <= GNU_PROPERTY_UINT32_OR_HI))
{
+ switch (type)
+ {
+ case GNU_PROPERTY_1_NEEDED:
+ if (datasz != 4)
+ printf (_("1_needed: <corrupt length: %#x> "),
+ datasz);
+ else
+ {
+ unsigned int bitmask = byte_get (ptr, 4);
+ printf ("1_needed: ");
+ decode_1_needed (bitmask);
+ }
+ goto next;
+
+ default:
+ break;
+ }
if (type <= GNU_PROPERTY_UINT32_AND_HI)
printf (_("UINT32_AND (%#x): "), type);
else
#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff
+/* The needed properties by the object file. */
+#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO
+
+/* Set if the object file requires canonical function pointers and
+ cannot be used with copy relocation. */
+#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0)
+
/* Processor-specific semantics, lo */
#define GNU_PROPERTY_LOPROC 0xc0000000
/* Processor-specific semantics, hi */
--- /dev/null
+ .section ".note.gnu.property", "a"
+ .p2align ALIGN
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align ALIGN
+2: .long 0xb0008000 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x3
+4:
+ .p2align ALIGN
+5:
--- /dev/null
+#source: empty.s
+#source: property-1_needed-1.s
+#as:
+#ld: -shared
+#readelf: -n
+#xfail: ![check_shared_lib_support]
+#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
+# Assembly source file for the HPPA assembler is renamed and modifed by
+# sed. mn10300 has relocations in .note.gnu.property section which
+# elf_parse_notes doesn't support.
+
+#...
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: 1_needed: indirect external access, <unknown: 2>
+#pass