Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2005 23:34:10 +0200
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, "Bjoern A. Zeeb" <bz@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf kern.post.mk kmod.mk
Message-ID:  <86vezi1w6l.fsf@xps.des.no>
In-Reply-To: <20051027204816.GX68470@ip.net.ua> (Ruslan Ermilov's message of "Thu, 27 Oct 2005 23:48:16 %2B0300")
References:  <200510271424.j9REOkr8091913@repoman.freebsd.org> <Pine.BSF.4.53.0510271714530.91525@e0-0.zab2.int.zabbadoz.net> <20051027174042.GK68470@ip.net.ua> <864q723dqt.fsf@xps.des.no> <20051027204816.GX68470@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Ruslan Ermilov <ru@FreeBSD.org> writes:
> sys/kern/link_elf_obj.c is what's used with current format module
> objects on amd64.  Can you see a problem there?

Yes.  AFAICT, it should select sections based on the presence of the
SHF_ALLOC bit in sh_flags.  See if the attached patch helps.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=link_elf_obj.diff

Index: sys/kern/link_elf_obj.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/link_elf_obj.c,v
retrieving revision 1.89
diff -u -r1.89 link_elf_obj.c
--- sys/kern/link_elf_obj.c	28 Aug 2005 05:38:40 -0000	1.89
+++ sys/kern/link_elf_obj.c	27 Oct 2005 21:32:48 -0000
@@ -225,6 +225,8 @@
 	symtabindex = -1;
 	symstrindex = -1;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_flags & SHF_ALLOC == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -295,6 +297,8 @@
 	rl = 0;
 	ra = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_flags & SHF_ALLOC == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -496,6 +500,8 @@
 	symtabindex = -1;
 	symstrindex = -1;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_flags & SHF_ALLOC == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -618,6 +624,8 @@
 	/* Size up code/data(progbits) and bss(nobits). */
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_flags & SHF_ALLOC == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -671,6 +679,8 @@
 	ra = 0;
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_flags & SHF_ALLOC == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:

--=-=-=--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86vezi1w6l.fsf>