| 876 | } |
| 877 | |
| 878 | static void shdr_write(struct elf_writer *ew, size_t n, struct buffer *m) |
| 879 | { |
| 880 | struct xdr *xdr = ew->xdr; |
| 881 | int bit64 = ew->bit64; |
| 882 | struct elf_writer_section *sec = &ew->sections[n]; |
| 883 | Elf64_Shdr *shdr = &sec->shdr; |
| 884 | |
| 885 | xdr->put32(m, shdr->sh_name); |
| 886 | xdr->put32(m, shdr->sh_type); |
| 887 | if (bit64) { |
| 888 | xdr->put64(m, shdr->sh_flags); |
| 889 | xdr->put64(m, shdr->sh_addr); |
| 890 | xdr->put64(m, shdr->sh_offset); |
| 891 | xdr->put64(m, shdr->sh_size); |
| 892 | xdr->put32(m, shdr->sh_link); |
| 893 | xdr->put32(m, shdr->sh_info); |
| 894 | xdr->put64(m, shdr->sh_addralign); |
| 895 | xdr->put64(m, shdr->sh_entsize); |
| 896 | } else { |
| 897 | xdr->put32(m, shdr->sh_flags); |
| 898 | xdr->put32(m, shdr->sh_addr); |
| 899 | xdr->put32(m, shdr->sh_offset); |
| 900 | xdr->put32(m, shdr->sh_size); |
| 901 | xdr->put32(m, shdr->sh_link); |
| 902 | xdr->put32(m, shdr->sh_info); |
| 903 | xdr->put32(m, shdr->sh_addralign); |
| 904 | xdr->put32(m, shdr->sh_entsize); |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | static void |
| 909 | phdr_write(struct elf_writer *ew, struct buffer *m, Elf64_Phdr *phdr) |
no outgoing calls
no test coverage detected