| Index: third_party/yasm/patched-yasm/modules/objfmts/elf/elf.c
|
| ===================================================================
|
| --- third_party/yasm/patched-yasm/modules/objfmts/elf/elf.c (revision 71129)
|
| +++ third_party/yasm/patched-yasm/modules/objfmts/elf/elf.c (working copy)
|
| @@ -26,7 +26,7 @@
|
| */
|
|
|
| #include <util.h>
|
| -/*@unused@*/ RCSID("$Id: elf.c 2040 2008-02-21 08:57:23Z peter $");
|
| +/*@unused@*/ RCSID("$Id: elf.c 2206 2009-07-21 06:48:42Z peter $");
|
|
|
| #include <libyasm.h>
|
| #define YASM_OBJFMT_ELF_INTERNAL
|
| @@ -43,12 +43,18 @@
|
|
|
| static void elf_symrec_data_destroy(/*@only@*/ void *d);
|
| static void elf_symtab_entry_print(void *data, FILE *f, int indent_level);
|
| +static void elf_ssym_symtab_entry_print(void *data, FILE *f, int indent_level);
|
|
|
| const yasm_assoc_data_callback elf_symrec_data = {
|
| elf_symrec_data_destroy,
|
| elf_symtab_entry_print
|
| };
|
|
|
| +const yasm_assoc_data_callback elf_ssym_symrec_data = {
|
| + elf_symrec_data_destroy,
|
| + elf_ssym_symtab_entry_print
|
| +};
|
| +
|
| extern elf_machine_handler
|
| elf_machine_handler_x86_x86,
|
| elf_machine_handler_x86_amd64;
|
| @@ -92,6 +98,8 @@
|
| elf_ssyms[i] = yasm_symtab_define_label(symtab,
|
| elf_march->ssyms[i].name,
|
| NULL, 0, 0);
|
| + yasm_symrec_add_data(elf_ssyms[i], &elf_ssym_symrec_data,
|
| + &elf_march->ssyms[i]);
|
| }
|
| }
|
|
|
| @@ -141,14 +149,15 @@
|
| yasm_symrec *wrt,
|
| yasm_intnum *addr,
|
| int rel,
|
| - size_t valsize)
|
| + size_t valsize,
|
| + int is_GOT_sym)
|
| {
|
| elf_reloc_entry *entry;
|
|
|
| if (!elf_march->accepts_reloc)
|
| yasm_internal_error(N_("Unsupported machine for ELF output"));
|
|
|
| - if (!elf_march->accepts_reloc(valsize, wrt, elf_ssyms))
|
| + if (!elf_march->accepts_reloc(valsize, wrt))
|
| {
|
| if (addr)
|
| yasm_intnum_destroy(addr);
|
| @@ -165,6 +174,7 @@
|
| entry->valsize = valsize;
|
| entry->addend = NULL;
|
| entry->wrt = wrt;
|
| + entry->is_GOT_sym = is_GOT_sym;
|
|
|
| return entry;
|
| }
|
| @@ -350,6 +360,12 @@
|
| fprintf(f, "\n");
|
| }
|
|
|
| +static void
|
| +elf_ssym_symtab_entry_print(void *data, FILE *f, int indent_level)
|
| +{
|
| + /* TODO */
|
| +}
|
| +
|
| elf_symtab_head *
|
| elf_symtab_create()
|
| {
|
| @@ -702,11 +718,13 @@
|
| }
|
|
|
| void
|
| -elf_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc)
|
| +elf_handle_reloc_addend(yasm_intnum *intn,
|
| + elf_reloc_entry *reloc,
|
| + unsigned long offset)
|
| {
|
| if (!elf_march->handle_reloc_addend)
|
| yasm_internal_error(N_("Unsupported machine for ELF output"));
|
| - elf_march->handle_reloc_addend(intn, reloc);
|
| + elf_march->handle_reloc_addend(intn, reloc, offset);
|
| }
|
|
|
| unsigned long
|
| @@ -778,7 +796,7 @@
|
| vis = yasm_symrec_get_visibility(reloc->reloc.sym);
|
| if (!elf_march->map_reloc_info_to_type)
|
| yasm_internal_error(N_("Unsupported arch/machine for elf output"));
|
| - r_type = elf_march->map_reloc_info_to_type(reloc, elf_ssyms);
|
| + r_type = elf_march->map_reloc_info_to_type(reloc);
|
|
|
| bufp = buf;
|
| if (!elf_march->write_reloc || !elf_march->reloc_entry_size)
|
|
|