bfd * coff-i386.c (in_reloc_p): Add R_SECTION.
(howto_table): Add R_SECTION.
(coff_pe_i386_relocation_section): Add support for R_SECTION.
(coff_i386_reloc_type_lookup): Add support for
BFD_RELOC_16_SECCIDX.
* coff-x86_64.c (in_reloc_p): Add R_SECTION.
(howto_table): Add R_SECTION.
(coff_pe_amd64_relocation_section): Add support for R_SECTION.
(coff_amd64_reloc_type_lookup): Add support for
BFD_RELOC_16_SECCIDX.
* reloc.c: Add BFD_RELOC_16_SECIDX.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
gas * config/tc-i386.c (pe_directive_secidx): New function.
(md_pseudo_table): Add support for secidx.
(x86_cons_fix_new): Likewise.
(tc_gen_reloc): Likewise.
* expr.c (op_rank): Add O_secidx.
* expr.h (operatorT): Likewise.
* symbols.c (resolve_symbol_value): Add support for O_secidx.
* testsuite/gas/i386/secidx.s: New test source file.
* testsuite/gas/i386/secidx.d: New test driver file.
* testsuite/gas/i386/i386.exp: Run new test.
include * coff/i386.h: Define R_SECTION.
* coff/x86_64.h: Likewise.
ld * testsuite/ld-pe/secidx1.s: New test source file.
* testsuite/ld-pe/secidx2.s: New test source file.
* testsuite/ld-pe/secidx.d: New test driver file.
* testsuite/ld-pe/secidx_64.d: New test driver file.
* testsuite/ld-pe/pe.exp: Add new tests.
+2022-04-07 Mark Harmstone <mark@harmstone.com>
+
+ * coff-i386.c (in_reloc_p): Add R_SECTION.
+ (howto_table): Add R_SECTION.
+ (coff_pe_i386_relocation_section): Add support for R_SECTION.
+ (coff_i386_reloc_type_lookup): Add support for
+ BFD_RELOC_16_SECCIDX.
+ * coff-x86_64.c (in_reloc_p): Add R_SECTION.
+ (howto_table): Add R_SECTION.
+ (coff_pe_amd64_relocation_section): Add support for R_SECTION.
+ (coff_amd64_reloc_type_lookup): Add support for
+ BFD_RELOC_16_SECCIDX.
+ * reloc.c: Add BFD_RELOC_16_SECIDX.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
2022-04-01 John Baldwin <jhb@FreeBSD.org>
* elf-bfd.h (elfcore_write_x86_segbases): New.
/* Section relative relocations. Some targets need this for DWARF2. */
BFD_RELOC_32_SECREL,
+ BFD_RELOC_16_SECIDX,
/* For ELF. */
BFD_RELOC_32_GOT_PCREL,
static bool
in_reloc_p (bfd *abfd ATTRIBUTE_UNUSED, reloc_howto_type *howto)
{
- return ! howto->pc_relative && howto->type != R_IMAGEBASE
- && howto->type != R_SECREL32;
+ return ! howto->pc_relative
+ && howto->type != R_IMAGEBASE
+ && howto->type != R_SECREL32
+ && howto->type != R_SECTION;
}
#endif /* COFF_WITH_PE */
false), /* pcrel_offset */
EMPTY_HOWTO (010),
EMPTY_HOWTO (011),
- EMPTY_HOWTO (012),
#ifdef COFF_WITH_PE
+ /* 16-bit word section relocation (012). */
+ HOWTO (R_SECTION, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_i386_reloc, /* special_function */
+ "secidx", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
/* 32-bit longword section relative relocation (013). */
HOWTO (R_SECREL32, /* type */
0, /* rightshift */
0xffffffff, /* dst_mask */
true), /* pcrel_offset */
#else
+ EMPTY_HOWTO (012),
EMPTY_HOWTO (013),
#endif
EMPTY_HOWTO (014),
#else /* COFF_WITH_PE */
-/* The PE relocate section routine. The only difference between this
- and the regular routine is that we don't want to do anything for a
- relocatable link. */
+/* The PE relocate section routine. We handle secidx relocations here,
+ as well as making sure that we don't do anything for a relocatable
+ link. */
static bool
coff_pe_i386_relocate_section (bfd *output_bfd,
struct internal_syment *syms,
asection **sections)
{
+ struct internal_reloc *rel;
+ struct internal_reloc *relend;
+
if (bfd_link_relocatable (info))
return true;
+ rel = relocs;
+ relend = rel + input_section->reloc_count;
+
+ for (; rel < relend; rel++)
+ {
+ long symndx;
+ struct coff_link_hash_entry *h;
+ asection *sec, *s;
+ uint16_t idx = 0, i = 1;
+
+ if (rel->r_type != R_SECTION)
+ continue;
+
+ /* Make sure that _bfd_coff_generic_relocate_section won't parse
+ this reloc after us. */
+ rel->r_type = 0;
+
+ symndx = rel->r_symndx;
+
+ if (symndx < 0
+ || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
+ continue;
+
+ h = obj_coff_sym_hashes (input_bfd)[symndx];
+
+ if (h == NULL)
+ sec = sections[symndx];
+ else
+ {
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ /* Defined weak symbols are a GNU extension. */
+ sec = h->root.u.def.section;
+ }
+ else
+ {
+ sec = NULL;
+ }
+ }
+
+ if (!sec)
+ continue;
+
+ if (bfd_is_abs_section (sec))
+ continue;
+
+ if (discarded_section (sec))
+ continue;
+
+ s = output_bfd->sections;
+ while (s)
+ {
+ if (s == sec->output_section)
+ {
+ idx = i;
+ break;
+ }
+
+ i++;
+ s = s->next;
+ }
+
+ bfd_putl16 (idx, contents + rel->r_vaddr - input_section->vma);
+ }
+
return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
input_section, contents,
relocs, syms, sections);
#ifdef COFF_WITH_PE
case BFD_RELOC_32_SECREL:
return howto_table + R_SECREL32;
+ case BFD_RELOC_16_SECIDX:
+ return howto_table + R_SECTION;
#endif
default:
BFD_FAIL ();
static bool
in_reloc_p (bfd *abfd ATTRIBUTE_UNUSED, reloc_howto_type *howto)
{
- return ! howto->pc_relative && howto->type != R_AMD64_IMAGEBASE
- && howto->type != R_AMD64_SECREL;
+ return ! howto->pc_relative
+ && howto->type != R_AMD64_IMAGEBASE
+ && howto->type != R_AMD64_SECREL
+ && howto->type != R_AMD64_SECTION;
}
#endif /* COFF_WITH_PE */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- EMPTY_HOWTO (10), /* R_AMD64_SECTION 10 */
#if defined(COFF_WITH_PE)
+ /* 16-bit word section relocation (10). */
+ HOWTO (R_AMD64_SECTION, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_amd64_reloc, /* special_function */
+ "IMAGE_REL_AMD64_SECTION", /* name */
+ true, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ true),
/* 32-bit longword section relative relocation (11). */
HOWTO (R_AMD64_SECREL, /* type */
0, /* rightshift */
0xffffffff, /* dst_mask */
true), /* pcrel_offset */
#else
+ EMPTY_HOWTO (10),
EMPTY_HOWTO (11),
#endif
EMPTY_HOWTO (12),
#else /* COFF_WITH_PE */
-/* The PE relocate section routine. The only difference between this
- and the regular routine is that we don't want to do anything for a
- relocatable link. */
+/* The PE relocate section routine. We handle secidx relocations here,
+ as well as making sure that we don't do anything for a relocatable
+ link. */
static bool
coff_pe_amd64_relocate_section (bfd *output_bfd,
struct internal_syment *syms,
asection **sections)
{
+ struct internal_reloc *rel;
+ struct internal_reloc *relend;
+
if (bfd_link_relocatable (info))
return true;
+ rel = relocs;
+ relend = rel + input_section->reloc_count;
+
+ for (; rel < relend; rel++)
+ {
+ long symndx;
+ struct coff_link_hash_entry *h;
+ asection *sec, *s;
+ uint16_t idx = 0, i = 1;
+
+ if (rel->r_type != R_SECTION)
+ continue;
+
+ /* Make sure that _bfd_coff_generic_relocate_section won't parse
+ this reloc after us. */
+ rel->r_type = 0;
+
+ symndx = rel->r_symndx;
+
+ if (symndx < 0
+ || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
+ continue;
+
+ h = obj_coff_sym_hashes (input_bfd)[symndx];
+
+ if (h == NULL)
+ sec = sections[symndx];
+ else
+ {
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ /* Defined weak symbols are a GNU extension. */
+ sec = h->root.u.def.section;
+ }
+ else
+ {
+ sec = NULL;
+ }
+ }
+
+ if (!sec)
+ continue;
+
+ if (bfd_is_abs_section (sec))
+ continue;
+
+ if (discarded_section (sec))
+ continue;
+
+ s = output_bfd->sections;
+ while (s)
+ {
+ if (s == sec->output_section)
+ {
+ idx = i;
+ break;
+ }
+
+ i++;
+ s = s->next;
+ }
+
+ bfd_putl16 (idx, contents + rel->r_vaddr - input_section->vma);
+ }
+
return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,input_section, contents,relocs, syms, sections);
}
#if defined(COFF_WITH_PE)
case BFD_RELOC_32_SECREL:
return howto_table + R_AMD64_SECREL;
+ case BFD_RELOC_16_SECIDX:
+ return howto_table + R_AMD64_SECTION;
#endif
default:
BFD_FAIL ();
"BFD_RELOC_12_PCREL",
"BFD_RELOC_8_PCREL",
"BFD_RELOC_32_SECREL",
+ "BFD_RELOC_16_SECIDX",
"BFD_RELOC_32_GOT_PCREL",
"BFD_RELOC_16_GOT_PCREL",
"BFD_RELOC_8_GOT_PCREL",
ENUM
BFD_RELOC_32_SECREL
+ENUMX
+ BFD_RELOC_16_SECIDX
ENUMDOC
Section relative relocations. Some targets need this for DWARF2.
+2022-04-07 Mark Harmstone <mark@harmstone.com>
+
+ * config/tc-i386.c (pe_directive_secidx): New function.
+ (md_pseudo_table): Add support for secidx.
+ (x86_cons_fix_new): Likewise.
+ (tc_gen_reloc): Likewise.
+ * expr.c (op_rank): Add O_secidx.
+ * expr.h (operatorT): Likewise.
+ * symbols.c (resolve_symbol_value): Add support for O_secidx.
+ * testsuite/gas/i386/secidx.s: New test source file.
+ * testsuite/gas/i386/secidx.d: New test driver file.
+ * testsuite/gas/i386/i386.exp: Run new test.
+
2022-04-07 Andreas Krebbel <krebbel@linux.ibm.com>
* config/tc-s390.c (s390_parse_cpu): Add z16 as alternate CPU
static void set_cpu_arch (int);
#ifdef TE_PE
static void pe_directive_secrel (int);
+static void pe_directive_secidx (int);
#endif
static void signed_cons (int);
static char *output_invalid (int c);
#endif
#ifdef TE_PE
{"secrel32", pe_directive_secrel, 0},
+ {"secidx", pe_directive_secidx, 0},
#endif
{0, 0, 0}
};
exp->X_op = O_symbol;
r = BFD_RELOC_32_SECREL;
}
+ else if (exp->X_op == O_secidx)
+ r = BFD_RELOC_16_SECIDX;
#endif
fix_new_exp (frag, off, len, exp, 0, r);
we don't yet know the operand size (this will be set by insn
matching). Hence we record the word32 relocation here,
and adjust the reloc according to the real size in reloc(). */
- static const struct {
+ static const struct
+ {
const char *str;
int len;
const enum bfd_reloc_code_real rel[2];
const i386_operand_type types64;
bool need_GOT_symbol;
- } gotrel[] = {
+ }
+ gotrel[] =
+ {
#ifndef TE_PE
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
{ STRING_COMMA_LEN ("SIZE"), { BFD_RELOC_SIZE32,
input_line_pointer--;
demand_empty_rest_of_line ();
}
+
+static void
+pe_directive_secidx (int dummy ATTRIBUTE_UNUSED)
+{
+ expressionS exp;
+
+ do
+ {
+ expression (&exp);
+ if (exp.X_op == O_symbol)
+ exp.X_op = O_secidx;
+
+ emit_expr (&exp, 2);
+ }
+ while (*input_line_pointer++ == ',');
+
+ input_line_pointer--;
+ demand_empty_rest_of_line ();
+}
#endif
/* Handle Vector operations. */
case BFD_RELOC_VTABLE_INHERIT:
#ifdef TE_PE
case BFD_RELOC_32_SECREL:
+ case BFD_RELOC_16_SECIDX:
#endif
code = fixp->fx_r_type;
break;
0, /* O_constant */
0, /* O_symbol */
0, /* O_symbol_rva */
+ 0, /* O_secidx */
0, /* O_register */
0, /* O_big */
9, /* O_uminus */
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-/*
- * By popular demand, we define a struct to represent an expression.
- * This will no doubt mutate as expressions become baroque.
- *
- * Currently, we support expressions like "foo OP bar + 42". In other
- * words we permit a (possibly undefined) symbol, a (possibly
- * undefined) symbol and the operation used to combine the symbols,
- * and an (absolute) augend. RMS says this is so we can have 1-pass
- * assembly for any compiler emissions, and a 'case' statement might
- * emit 'undefined1 - undefined2'.
- *
- * The type of an expression used to be stored as a segment. That got
- * confusing because it overloaded the concept of a segment. I added
- * an operator field, instead.
- */
+/* By popular demand, we define a struct to represent an expression.
+ This will no doubt mutate as expressions become baroque.
+
+ Currently, we support expressions like "foo OP bar + 42". In other
+ words we permit a (possibly undefined) symbol, a (possibly
+ undefined) symbol and the operation used to combine the symbols,
+ and an (absolute) augend. RMS says this is so we can have 1-pass
+ assembly for any compiler emissions, and a 'case' statement might
+ emit 'undefined1 - undefined2'.
+
+ The type of an expression used to be stored as a segment. That got
+ confusing because it overloaded the concept of a segment. I added
+ an operator field, instead. */
/* This is the type of an expression. The operator types are also
used while parsing an expression.
NOTE: This enumeration must match the op_rank array in expr.c. */
-typedef enum {
+typedef enum
+{
/* An illegal expression. */
O_illegal,
/* A nonexistent expression. */
O_symbol,
/* X_add_symbol + X_add_number - the base address of the image. */
O_symbol_rva,
+ /* The section index of X_add_symbol. */
+ O_secidx,
/* A register (X_add_number is register number). */
O_register,
/* A big value. If X_add_number is negative or 0, the value is in
O_max
} operatorT;
-typedef struct expressionS {
+typedef struct expressionS
+{
/* The main symbol. */
symbolS *X_add_symbol;
/* The second symbol, if needed. */
extern symbolS *make_expr_symbol (expressionS * expressionP);
extern int expr_symbol_where (symbolS *, const char **, unsigned int *);
extern void current_location (expressionS *);
-
extern symbolS *expr_build_uconstant (offsetT);
extern symbolS *expr_build_dot (void);
extern uint32_t generic_bignum_to_int32 (void);
extern uint64_t generic_bignum_to_int64 (void);
-
-int resolve_expression (expressionS *);
+extern int resolve_expression (expressionS *);
extern bool literal_prefix_dollar_hex;
case O_symbol:
case O_symbol_rva:
+ case O_secidx:
left = resolve_symbol_value (add_symbol);
seg_left = S_GET_SEGMENT (add_symbol);
if (finalize_syms)
final_val += symp->frag->fr_address + left;
resolved = symbol_resolved_p (add_symbol);
symp->flags.resolving = 0;
+
+ if (op == O_secidx && seg_left != undefined_section)
+ {
+ final_val = 0;
+ break;
+ }
+
goto exit_dont_set_value;
}
else
}
}
- # This is a PE specific test.
+ # These are PE specific tests.
if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
|| [istarget "*-*-mingw*"]
} then {
run_dump_test "secrel"
+ run_dump_test "secidx"
}
# Miscellaneous tests.
--- /dev/null
+#objdump: -rs
+#name: i386 secidx reloc
+
+.*: +file format pe-i386
+
+RELOCATION RECORDS FOR \[\.data\]:
+OFFSET[ ]+TYPE[ ]+VALUE
+0+24 secidx \.text
+0+27 secidx \.text
+0+2a secidx \.text
+0+2d secidx \.text
+0+3c secidx \.data
+0+3f secidx \.data
+0+42 secidx \.data
+0+45 secidx \.data
+0+54 secidx \.rdata
+0+57 secidx \.rdata
+0+5a secidx \.rdata
+0+5d secidx \.rdata
+0+6c secidx ext24
+0+6f secidx ext2d
+0+72 secidx ext36
+0+75 secidx ext3f
+
+Contents of section \.text:
+ 0000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ 0010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+Contents of section \.data:
+ 0000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ 0010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ 0020 3e3e3e3e 00001100 00110000 11000011 >>>>............
+ 0030 3c3c3c3c 3c3c3c3c 3e3e3e3e 00001100 <<<<<<<<>>>>....
+ 0040 00110000 11000011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+ 0050 3e3e3e3e 00001100 00110000 11000011 >>>>............
+ 0060 3c3c3c3c 3c3c3c3c 3e3e3e3e 00001100 <<<<<<<<>>>>....
+ 0070 00110000 11000011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+Contents of section \.rdata:
+ 0000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ 0010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ 0020 3e3e3e3e 00000000 00000000 00000000 >>>>............
--- /dev/null
+.text
+
+ .ascii ">>>>"
+pre04: .ascii "<<<<"
+ .ascii ">>>>>"
+pre0d: .ascii "<<<"
+ .ascii ">>>>>>"
+pre16: .ascii "<<"
+ .ascii ">>>>>>>"
+pre1f: .ascii "<"
+
+.data
+
+ .ascii ">>>>"
+sam04: .ascii "<<<<"
+ .ascii ">>>>>"
+sam0d: .ascii "<<<"
+ .ascii ">>>>>>"
+sam16: .ascii "<<"
+ .ascii ">>>>>>>"
+sam1f: .ascii "<"
+
+ .ascii ">>>>"
+ .secidx pre04
+ .byte 0x11
+ .secidx pre0d
+ .byte 0x11
+ .secidx pre16
+ .byte 0x11
+ .secidx pre1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx sam04
+ .byte 0x11
+ .secidx sam0d
+ .byte 0x11
+ .secidx sam16
+ .byte 0x11
+ .secidx sam1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx nex04
+ .byte 0x11
+ .secidx nex0d
+ .byte 0x11
+ .secidx nex16
+ .byte 0x11
+ .secidx nex1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx ext24
+ .byte 0x11
+ .secidx ext2d
+ .byte 0x11
+ .secidx ext36
+ .byte 0x11
+ .secidx ext3f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+.section .rdata
+
+ .ascii ">>>>"
+nex04: .ascii "<<<<"
+ .ascii ">>>>>"
+nex0d: .ascii "<<<"
+ .ascii ">>>>>>"
+nex16: .ascii "<<"
+ .ascii ">>>>>>>"
+nex1f: .ascii "<"
+ .ascii ">>>>"
+
+ .p2align 4,0
+2022-04-07 Mark Harmstone <mark@harmstone.com>
+
+ * coff/i386.h: Define R_SECTION.
+ * coff/x86_64.h: Likewise.
+
2022-04-01 John Baldwin <jhb@FreeBSD.org>
* elf/common.h (NT_FREEBSD_X86_SEGBASES): Define.
#define R_DIR32 6
#define R_IMAGEBASE 7
+#define R_SECTION 10
#define R_SECREL32 11
#define R_RELBYTE 15
#define R_RELWORD 16
#define R_DIR32 6
#define R_IMAGEBASE 7
+#define R_SECTION 10
#define R_SECREL32 11
#define R_RELBYTE 15
#define R_RELWORD 16
+2022-04-07 Mark Harmstone <mark@harmstone.com>
+
+ * testsuite/ld-pe/secidx1.s: New test source file.
+ * testsuite/ld-pe/secidx2.s: New test source file.
+ * testsuite/ld-pe/secidx.d: New test driver file.
+ * testsuite/ld-pe/secidx_64.d: New test driver file.
+ * testsuite/ld-pe/pe.exp: Add new tests.
+
2022-03-01 Nick Clifton <nickc@redhat.com>
PR 21964
set pe_tests {
{".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel_64.d}} "secrel.x"}
+ {".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx_64.d}} "secidx.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports64.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
set pe_tests {
{".secrel32" "--disable-auto-import --disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {".secidx" "--disable-auto-import --disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx.d}} "secidx.x"}
+ {"Empty export table" "" "" "" "exports.s"
+ {{objdump -p exports.d}} "exports.dll"}
+ {"TLS directory entry" "" "" "" "tlssec.s"
+ {{objdump -p tlssec32.d}} "tlssec.dll"}
+ }
+ } elseif {[istarget arm-wince-pe] } {
+ set pe_tests {
+ {".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
+ {{objdump -s secrel.d}} "secrel.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
set pe_tests {
{".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx.d}} "secidx.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
--- /dev/null
+
+tmpdir/secidx\.x: +file format pei-.*
+
+Contents of section .text:
+ .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*1020 3c3c3c3c 3e3e3e3e 3e909090 ffffffff <<<<>>>>>.......
+ .*1030 00000000 ffffffff 00000000 ............
+Contents of section .data:
+ .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*2020 3e3e3e3e 01001101 00110100 11010011 >>>>............
+ .*2030 3c3c3c3c 3c3c3c3c 3e3e3e3e 02001102 <<<<<<<<>>>>....
+ .*2040 00110200 11020011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+ .*2050 3e3e3e3e 03001103 00110300 11030011 >>>>............
+ .*2060 3c3c3c3c 3c3c3c3c 3e3e3e3e 01001102 <<<<<<<<>>>>....
+ .*2070 00110300 113c3c3c 3c3c3c3c 3c000000 .....<<<<<<<<...
+ .*2080 3c3c3c3e 3e3e3e3e 3e000000 <<<>>>>>>...
+Contents of section .rdata:
+ .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............
+ .*3030 3c3c3c3e 3e3e3e3e 3e000000 <<<>>>>>>...
+Contents of section .idata:
+ .*4000 00000000 00000000 00000000 00000000 ................
+ .*4010 00000000 ....
+#...
--- /dev/null
+.text
+
+ .ascii ">>>>"
+pre04: .ascii "<<<<"
+ .ascii ">>>>>"
+pre0d: .ascii "<<<"
+ .ascii ">>>>>>"
+pre16: .ascii "<<"
+ .ascii ">>>>>>>"
+pre1f: .ascii "<"
+
+.data
+
+ .ascii ">>>>"
+sam04: .ascii "<<<<"
+ .ascii ">>>>>"
+sam0d: .ascii "<<<"
+ .ascii ">>>>>>"
+sam16: .ascii "<<"
+ .ascii ">>>>>>>"
+sam1f: .ascii "<"
+
+ .ascii ">>>>"
+ .secidx pre04
+ .byte 0x11
+ .secidx pre0d
+ .byte 0x11
+ .secidx pre16
+ .byte 0x11
+ .secidx pre1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx sam04
+ .byte 0x11
+ .secidx sam0d
+ .byte 0x11
+ .secidx sam16
+ .byte 0x11
+ .secidx sam1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx nex04
+ .byte 0x11
+ .secidx nex0d
+ .byte 0x11
+ .secidx nex16
+ .byte 0x11
+ .secidx nex1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx ext1
+ .byte 0x11
+ .secidx ext2
+ .byte 0x11
+ .secidx ext3
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+.section .rdata
+
+ .ascii ">>>>"
+nex04: .ascii "<<<<"
+ .ascii ">>>>>"
+nex0d: .ascii "<<<"
+ .ascii ">>>>>>"
+nex16: .ascii "<<"
+ .ascii ">>>>>>>"
+nex1f: .ascii "<"
+ .ascii ">>>>"
+
+ .p2align 4,0
--- /dev/null
+.text
+
+.global ext1
+ext1: .ascii "<<<<"
+ .ascii ">>>>>"
+
+.data
+
+.global ext2
+ext2: .ascii "<<<"
+ .ascii ">>>>>>"
+
+.section .rdata
+
+.global ext3
+ext3: .ascii "<<<"
+ .ascii ">>>>>>"
--- /dev/null
+
+tmpdir/secidx\.x: +file format pei-.*
+
+Contents of section \.text:
+ .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*1020 3c3c3c3c 3e3e3e3e 3e909090 90909090 <<<<>>>>>.......
+ .*1030 ffffffff ffffffff 00000000 00000000 ................
+ .*1040 ffffffff ffffffff 00000000 00000000 ................
+Contents of section \.data:
+ .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*2020 3e3e3e3e 01001101 00110100 11010011 >>>>............
+ .*2030 3c3c3c3c 3c3c3c3c 3e3e3e3e 02001102 <<<<<<<<>>>>....
+ .*2040 00110200 11020011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+ .*2050 3e3e3e3e 03001103 00110300 11030011 >>>>............
+ .*2060 3c3c3c3c 3c3c3c3c 3e3e3e3e 01001102 <<<<<<<<>>>>....
+ .*2070 00110300 113c3c3c 3c3c3c3c 3c000000 .....<<<<<<<<...
+ .*2080 3c3c3c3e 3e3e3e3e 3e000000 00000000 <<<>>>>>>.......
+Contents of section \.rdata:
+ .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............
+ .*3030 3c3c3c3e 3e3e3e3e 3e000000 00000000 <<<>>>>>>.......
+Contents of section \.idata:
+ .*4000 00000000 00000000 00000000 00000000 ................
+ .*4010 00000000 ....