Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148809120
D13957.id50211.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D13957.id50211.diff
View Options
Index: head/usr.sbin/kldxref/ef.c
===================================================================
--- head/usr.sbin/kldxref/ef.c
+++ head/usr.sbin/kldxref/ef.c
@@ -80,7 +80,7 @@
};
static void ef_print_phdr(Elf_Phdr *);
-static u_long ef_get_offset(elf_file_t, Elf_Off);
+static Elf_Off ef_get_offset(elf_file_t, Elf_Off);
static int ef_parse_dynamic(elf_file_t);
static int ef_get_type(elf_file_t ef);
@@ -126,16 +126,17 @@
{
if ((phdr->p_flags & PF_W) == 0) {
- printf("text=0x%lx ", (long)phdr->p_filesz);
+ printf("text=0x%jx ", (uintmax_t)phdr->p_filesz);
} else {
- printf("data=0x%lx", (long)phdr->p_filesz);
+ printf("data=0x%jx", (uintmax_t)phdr->p_filesz);
if (phdr->p_filesz < phdr->p_memsz)
- printf("+0x%lx", (long)(phdr->p_memsz - phdr->p_filesz));
+ printf("+0x%jx",
+ (uintmax_t)(phdr->p_memsz - phdr->p_filesz));
printf(" ");
}
}
-static u_long
+static Elf_Off
ef_get_offset(elf_file_t ef, Elf_Off off)
{
Elf_Phdr *ph;
@@ -292,8 +293,8 @@
error = ef_read(ef, ef_get_offset(ef, dp->d_un.d_ptr),
sizeof(hashhdr), hashhdr);
if (error != 0) {
- warnx("can't read hash header (%lx)",
- ef_get_offset(ef, dp->d_un.d_ptr));
+ warnx("can't read hash header (%jx)",
+ (uintmax_t)ef_get_offset(ef, dp->d_un.d_ptr));
return (error);
}
ef->ef_nbuckets = hashhdr[0];
@@ -365,8 +366,8 @@
ef->ef_nchains * sizeof(Elf_Sym),
(void **)&ef->ef_symtab) != 0) {
if (ef->ef_verbose)
- warnx("%s: can't load .dynsym section (0x%lx)",
- ef->ef_name, (long)ef->ef_symoff);
+ warnx("%s: can't load .dynsym section (0x%jx)",
+ ef->ef_name, (uintmax_t)ef->ef_symoff);
return (EIO);
}
if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_stroff), ef->ef_strsz,
@@ -461,13 +462,13 @@
static int
ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest)
{
- u_long ofs;
+ Elf_Off ofs;
ofs = ef_get_offset(ef, offset);
if (ofs == 0) {
if (ef->ef_verbose)
- warnx("ef_seg_read(%s): zero offset (%lx:%ld)",
- ef->ef_name, (long)offset, ofs);
+ warnx("ef_seg_read(%s): zero offset (%jx:%ju)",
+ ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs);
return (EFAULT);
}
return (ef_read(ef, ofs, len, dest));
@@ -476,7 +477,7 @@
static int
ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest)
{
- u_long ofs;
+ Elf_Off ofs;
const Elf_Rela *a;
const Elf_Rel *r;
int error;
@@ -484,8 +485,8 @@
ofs = ef_get_offset(ef, offset);
if (ofs == 0) {
if (ef->ef_verbose)
- warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)",
- ef->ef_name, (long)offset, ofs);
+ warnx("ef_seg_read_rel(%s): zero offset (%jx:%ju)",
+ ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs);
return (EFAULT);
}
if ((error = ef_read(ef, ofs, len, dest)) != 0)
@@ -509,14 +510,14 @@
static int
ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest)
{
- u_long ofs;
+ Elf_Off ofs;
ssize_t r;
ofs = ef_get_offset(ef, offset);
if (ofs == 0 || ofs == (Elf_Off)-1) {
if (ef->ef_verbose)
- warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)",
- ef->ef_name, (long)offset, ofs);
+ warnx("ef_seg_read_string(%s): bad offset (%jx:%ju)",
+ ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs);
return (EFAULT);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 21, 7:57 AM (13 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30012531
Default Alt Text
D13957.id50211.diff (3 KB)
Attached To
Mode
D13957: kldxref: change ef_get_offset() return to Elf_Off
Attached
Detach File
Event Timeline
Log In to Comment