Patchwork mips: Don't use MIN in dl-machine.h

login
register
mail settings
Submitter H.J. Lu
Date Nov. 30, 2017, 10:54 p.m.
Message ID <20171130225456.GA51351@intel.com>
Download mbox | patch
Permalink /patch/24647/
State New
Headers show

Comments

H.J. Lu - Nov. 30, 2017, 10:54 p.m.
MIN is used, but param.h may not be included, so expand its single use
inline.

Tested with build-many-glibcs.py.  OK for master?

H.J.
--
	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Expand MIN.
---
 sysdeps/mips/dl-machine.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Joseph Myers - Nov. 30, 2017, 11:41 p.m.
On Thu, 30 Nov 2017, H.J. Lu wrote:

> MIN is used, but param.h may not be included, so expand its single use
> inline.
> 
> Tested with build-many-glibcs.py.  OK for master?

OK.

Patch

diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index da9d6332ea..904824b908 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -695,7 +695,8 @@  elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
 			      RTLD_PROGNAME, strtab + refsym->st_name);
 	  }
 	memcpy (reloc_addr, (void *) value,
-		MIN (sym->st_size, refsym->st_size));
+		sym->st_size < refsym->st_size
+		? sym->st_size : refsym->st_size);
 	break;
       }