summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
committersjg <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
commit62bb1062226d3ce6a2350808256a25508978352d (patch)
tree22b131dceb13c3df96da594fbaadb693504797c7 /usr.sbin/pkg
parent72ab90509b3a51ab361bf710338f2ef44a4e360d (diff)
parent04932445481c2cb89ff69a83b961bdef3d64757e (diff)
downloadFreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip
FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz
Merge from head
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r--usr.sbin/pkg/config.c22
-rw-r--r--usr.sbin/pkg/dns_utils.c2
2 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c
index 5924d57..142fd1b 100644
--- a/usr.sbin/pkg/config.c
+++ b/usr.sbin/pkg/config.c
@@ -108,7 +108,7 @@ pkg_get_myabi(char *dest, size_t sz)
Elf_Note note;
Elf_Scn *scn;
char *src, *osname;
- const char *abi;
+ const char *abi, *fpu;
GElf_Ehdr elfhdr;
GElf_Shdr shdr;
int fd, i, ret;
@@ -187,13 +187,25 @@ pkg_get_myabi(char *dest, size_t sz)
switch (elfhdr.e_machine) {
case EM_ARM:
+ /* FreeBSD doesn't support the hard-float ABI yet */
+ fpu = "softfp";
+ if ((elfhdr.e_flags & 0xFF000000) != 0) {
+ /* This is an EABI file, the conformance level is set */
+ abi = "eabi";
+ } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) {
+ /*
+ * EABI executables all have this field set to
+ * ELFOSABI_NONE, therefore it must be an oabi file.
+ */
+ abi = "oabi";
+ } else {
+ ret = 1;
+ goto cleanup;
+ }
snprintf(dest + strlen(dest), sz - strlen(dest),
":%s:%s:%s", elf_corres_to_string(endian_corres,
(int)elfhdr.e_ident[EI_DATA]),
- (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ?
- "eabi" : "oabi",
- (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ?
- "softfp" : "vfp");
+ abi, fpu);
break;
case EM_MIPS:
/*
diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c
index 239be90..cbdb3d5 100644
--- a/usr.sbin/pkg/dns_utils.c
+++ b/usr.sbin/pkg/dns_utils.c
@@ -66,7 +66,7 @@ dns_getsrvinfo(const char *zone)
p += len + NS_QFIXEDSZ;
}
- res = calloc(ancount, sizeof(struct dns_srvinfo));
+ res = calloc(ancount, sizeof(struct dns_srvinfo *));
if (res == NULL)
return (NULL);
OpenPOWER on IntegriCloud