From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:master commit in: misc/elf-abi/
Date: Mon, 5 Jan 2015 16:26:28 +0000 (UTC) [thread overview]
Message-ID: <1420475246.710cbb8d24db7bbc64af06921ba281b752e5ef99.blueness@gentoo> (raw)
commit: 710cbb8d24db7bbc64af06921ba281b752e5ef99
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 5 16:27:26 2015 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Jan 5 16:27:26 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=710cbb8d
misc/elf-abi: remove endian code
---
misc/elf-abi/elf-abi.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/misc/elf-abi/elf-abi.c b/misc/elf-abi/elf-abi.c
index 6b3a9c2..0a271ba 100644
--- a/misc/elf-abi/elf-abi.c
+++ b/misc/elf-abi/elf-abi.c
@@ -67,8 +67,6 @@
#define ELFCLASS32 1 /* 32-bit objects */
#define ELFCLASS64 2 /* 64-bit objects */
-#define ELFDATA2LSB 1 /* 2's complement, little endian */
-#define ELFDATA2MSB 2 /* 2's complement, big endian */
#define EM_SPARC 2 /* SUN SPARC */
#define EM_386 3 /* Intel 80386 */
@@ -116,20 +114,6 @@ get_wordsize(uint8_t ei_class)
}
-int
-get_endian(uint8_t ei_data)
-{
- switch (ei_data) {
- case ELFDATA2LSB:
- return -1;
- case ELFDATA2MSB:
- return 1;
- default:
- return 0;
- }
-}
-
-
char *
get_abi(uint16_t e_machine, int width, uint32_t e_flags)
{
@@ -175,14 +159,12 @@ int
main(int argc, char* argv[])
{
int width; /* Machine word size. Either 32 or 64 bits. */
- int endian; /* Endian, -1 = little, 1 = big */
char *abi; /* Abi name from glibc's <bits/syscall.h> */
int fd; /* file descriptor for opened Elf object. */
struct stat s; /* stat on opened Elf object. */
char magic[4]; /* magic number at the begining of the file */
uint8_t ei_class; /* ei_class is one byte of e_ident[] */
- uint8_t ei_data; /* ei_data is one byte of e_ident[] */
uint16_t e_machine; /* Size is Elf32_Half or Elf64_Half. Both are 2 bytes. */
uint32_t e_flags; /* Size is Elf32_Word or Elf64_Word. Both are 4 bytes. */
uint64_t e_machine_offset, e_flags_offset; /* Wide enough for either 32 or 64 bits. */
@@ -208,11 +190,6 @@ main(int argc, char* argv[])
err(1, "read() ei_class failed");
width = get_wordsize(ei_class);
- /* Little or Big Endian? */
- if (read(fd, &ei_data, 1) == -1)
- err(1, "read() ei_data failed");
- endian = get_endian(ei_data);
-
/*
All Elf files begin with the following Elf header:
unsigned char e_ident[EI_NIDENT]; - 16 bytes
next reply other threads:[~2015-01-05 16:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 16:26 Anthony G. Basile [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-01-06 21:43 [gentoo-commits] proj/elfix:master commit in: misc/elf-abi/ Anthony G. Basile
2015-01-06 21:34 Anthony G. Basile
2015-01-06 20:47 Anthony G. Basile
2015-01-06 18:22 Anthony G. Basile
2015-01-06 17:26 Anthony G. Basile
2015-01-06 15:13 Anthony G. Basile
2015-01-05 16:23 Anthony G. Basile
2015-01-03 23:53 Anthony G. Basile
2015-01-03 23:49 Anthony G. Basile
2015-01-03 23:19 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420475246.710cbb8d24db7bbc64af06921ba281b752e5ef99.blueness@gentoo \
--to=blueness@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox